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

Why is Animation not loading when player activates tool?

when the player activates the tool from a server script a remoteEvent picks up and should play the animation, but nothing is happening. even when the animation priority is set to Action. Please help!

local tool = script.Parent
local remoteEvent = tool:WaitForChild("RemoteEvent1")

remoteEvent.OnClientEvent:Connect(function()
	print("p")
	local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
	animation:Play()
end)

1 comment

0

You don't need a remote event for that, animations are replicated from client to server

2 answers

✓ Accepted answer

You dont need a remote event, you should make something like this:

local tool = script.Parent

tool.Activated:Connect(function()

print("p")  
Animation=game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
	Animation:Play()
end)

Also use a local script

1 comment

0

i did this and nothing is happening

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