Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I loop animations continuously?

Asked by 5 years ago

Hey, I'm trying to make it so that all the characters are constantly dancing. When I test it, it works but the animation stops after I move. How can I make it so that it continues forever? Does my game being R15/R6 have any effect on it? I put this script in StarterCharacterScripts and StarterPlayerScripts

Asset = "http://www.roblox.com/Asset?id="
IDs = {507771019,507771955,507772104,507776043,507776720,507776879,507777268,507777451,507777623}
Anims = {}
AnimsL = {}
Human = script.Parent:WaitForChild("Humanoid")

for i=1, #IDs do
    local Anim = Instance.new("Animation")
    Anim.AnimationId = (Asset..IDs[math.random(1,#IDs)])
    table.insert(Anims,Anim)
    wait()
end

for i=1, #Anims do
    local AnimL = Human:LoadAnimation(Anims[i])
    table.insert(AnimsL,AnimL)
    wait()
end


while true do
    local Dance = AnimsL[math.random(1,#AnimsL)]
    Dance:Play()
    wait(15)
end
0
you need to set the loop to true inside animation editor User#23365 30 — 5y
0
Please use local variables lol User#19524 175 — 5y

Answer this question