So I have this script and it only plays two animations at the current time since that was all I have done, but say I wanted to play 3 or maybe four animations in a random order. How would I do this? Would I make a table of some sort?
local uis = game:GetService("UserInputService");
local plrs = game:GetService("Players");
local cooldown = false
local leftp = false
uis.InputBegan:Connect(function(obj, gp)
if obj.KeyCode == Enum.KeyCode.Q and not gp then
leftp = not(leftp)
script.Damage.Disabled = false
if cooldown then
return
end
cooldown = true
if leftp then
local anim1 = plrs.LocalPlayer.Character.Humanoid:LoadAnimation(script.LPunch)
anim1:Play()
else
local anim2 = plrs.LocalPlayer.Character.Humanoid:LoadAnimation(script.RPunch)
anim2:Play()
end
wait(0.5)
cooldown = false
end
end)

2 comments
Thank you for the help.
Glad to help.