Please help im trying to play an animation when the tool is activated.
local tool = script.Parent
local anim = tool:WaitForChild("Throwanim")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local loadanim = humanoid:LoadAnimation(anim)
tool.Activated:Connect(function()
if not loadanim.IsPlaying then
loadanim:Play()
end
end)
No, what I meant was playing a client animation in client (local script) replicates on server.
So you CANT just script this on serverside. but you can just keep it as local script.
As @TheESPPlayerSeemoney said, animations played on the client are automatically replicated to the server.
It is possible to play the animation from a server script; however, this behavior is not recommended. When animations are played on the server they hog up vital memory that the server could be using for more important tasks. Server-sided animations also appear choppy to many players due to the latency difference. If something can be done reliably on the client, keep it on the client.