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

Why is Animation not loading when player activates tool?

Asked by 4 years ago

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)
0
You don't need a remote event for that, animations are replicated from client to server Leamir 3138 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

0
i did this and nothing is happening ffancyaxax12 181 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

I was in R15 instead of R6.

Answer this question