#help me pls?

1 messages · Page 1 of 1 (latest)

hexed thunder
#

this script make me only play the animation when i play the game all 4, i want to make when i click m1 they play each in sequence i know it require userinputservice but i don know how to use it im new pls help me anyone

#

task.wait(2)

local Rig = game.Players.LocalPlayer.Character
local Animator = Instance.new('Animator')
Animator.Parent = Rig.Humanoid

local animations = {
script.Hit1Animation,
script.Hit2Animation,
script.Hit3Animation,
script.Hit4Animation
}

local function playComboAnimations()
for i = 1, #animations do
local anim = Animator:LoadAnimation(animations[i])
anim:Play()
anim.Stopped:Wait() -- Wait for the animation to finish before continuing to the next one
end
end

playComboAnimations()

true ice
#

and then make an input for mousebutton1

#

hold up

hexed thunder
#

?

true ice
#
local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
    if gameProcessedEvent then return end
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        print("m1") --m1 function
    end
end)
#

input argument is for the input (no shit)
gameprocessedevent is to detect if the player is on a gui (so it doesnt trigger when youre on the menu)

#

so basically this code checks every user input you do (anything ranging from any mouse clicks or keyboard or touchpad)

#

and the (if input.userinputtype ----) makes it so something happens if you input that certain thing

#

also most buttons are input.Keycode and not input.UserInputType

hollow needleBOT
#

studio** You are now Level 7! **studio

true ice
#

when you use input.Keycode dont forget to change the enum type too (enum.keycode)

#

@hexed thunder

hexed thunder
#

kk thx its fix

hexed thunder
#

ad

hollow needleBOT
#

studio** You are now Level 4! **studio

hexed thunder
#

dada

#

s