Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make player do a default dance?

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)

2 comments

1

put: animTrack.Looped = true

0

dont use instance.new and animations i find that to not work sometimes

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.