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

How to make a animation play on a player (server sided)?

Asked by 4 years ago

Does anyone know how to make a animation play server sided so I can see it and my friend can? can someone help please im trash at scripting

1 answer

Log in to vote
0
Answered by 4 years ago

All you need is a localscript, because animations always replicate and are always server-sided.

Inside the localscript you need to insert an animation object, and input the animation ID in it (which I assume you have).

Then do this script

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char.Humanoid

local animation = hum:LoadAnimation(script.Animation)
animation:Play()

This is a VERY basic script, which plays the animation. You require more scripting if you want to get specific (such as animate only when walking, only when key is held, etc. Since you did not specify, I gave you a base to work out of). Hope this helps.

0
Thanks so much! no0bgaming748 24 — 4y
0
I have a dance list how do I know what animation to make it load? no0bgaming748 24 — 4y
0
That's a bit complicated, though all you would need to do is change "hum:LoadAnimation(script.Animation)". There's multiple solutions. A simple one would be ti simply change hum:LoadAnimation(script.Animation) to another animation, like hum:LoadAnimation(script.Animation2). There can be better ways but this is the easiest in general. Then set animations ID for each one. xMicro_Canary 37 — 4y
Ad

Answer this question