local attacks = script:GetChildren() for i,v in pairs(attacks) do local chosenAttack = math.random(#attacks) script.Parent.Humanoid:LoadAnimation(chosenAttack):Play() --[[ this picks only 1 random attack, and plays it once. how do i make it randomly play the animations with a 2 second delay? ]] end
Simple fix! wait(x) x = Seconds (must be a real number.*)
What is wait? wait is a delay function, Whatever goes in () is in seconds.
Examples of wait wait(1) < waiting one second print(waited one second)
local attacks = script:GetChildren() for i,v in pairs(attacks) do local chosenAttack = math.random(#attacks) wait(2) script.Parent.Humanoid:LoadAnimation(chosenAttack):Play() end