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

How do I make player do a default dance?

Asked by 6 years ago
Edited 6 years ago

I am trying to make the local player do a default dance, and it worked (mostly) , but either sometimes it wouldn't work, or it would only work for a couple seconds, so I added a loop, but that does not work either, because it is too fast of a loop and I do not know the exact time to do. Can anybody help me with this, I've already looked for this type of stuff but there is nothing to answer my question.

Server Script:

replicatedStorage = game:GetService("ReplicatedStorage")
replicatedStorage.RE.Dance3.dance3:FireClient(plr,true)

LocalScript:

function dance3(operation)
    if operation == true then
        local name = game.Players.LocalPlayer.Name
        local Humanoid = game.Workspace:WaitForChild(name).Humanoid
        local animation = Instance.new("Animation")
        animation.AnimationId = "http://www.roblox.com/asset/?id=182436935"
        game.ReplicatedStorage.RE.Dance3.Value.Value = true
        local animTrack = Humanoid:LoadAnimation(animation)
        while game.ReplicatedStorage.RE.Dance3.Value.Value == true do
            wait()
            animTrack:Play()
        end
    elseif operation == false then
        game.ReplicatedStorage.RE.Dance3.Value.Value = false
    end
end
game.ReplicatedStorage.RE.Dance3.dance3.OnClientEvent:Connect(dance3)
1
put: animTrack.Looped = true yHasteeD 1819 — 6y
0
dont use instance.new and animations i find that to not work sometimes Clasterboy 72 — 6y

1 answer

Log in to vote
0
Answered by
Lucke0051 165
5 years ago

I think your problem might be that the animation's priority is too low, consider changing it to Action. Do that in the animation editor.

Ad

Answer this question