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

Should I use local or server script for changing walk and idle animation?

Asked by 4 years ago

Basically i'm trying to make a players walk and idle animation change when they equip a tool. Is it possible to do this with a local script and have it show to everyone else or no?

0
You would have to edit the default "Animate" script (which is a local script) by adding a new animation to it and adding a function which would allow that animation to run depending a certain variable. Then put it in "StarterCharacterScripts" and it will override the one that is in the player by default. SynthetickDev 188 — 4y
0
I don't quite get what you mean by this, yes I know I have to mess with the normal animation script but should I use a local or server to change it. XX_Doggoa 24 — 4y

1 answer

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
4 years ago

Here is how you could do this using a Server Script insert a Server Script into ServerScriptService and insert the code below into the Script

game.Players.PlayerAdded:Connect(function(player)   

local Character = workspace:WaitForChild(player.Name)
local Animate = Character:WaitForChild('Animate')

local Walk = Animate:WaitForChild('run'):WaitForChild('RunAnim') -- Walk Anim
Walk.AnimationId = 0 -- replace "0" with animation Id

local Idle = Animate:WaitForChild('idle'):WaitForChild('Animation1') -- Standing
Idle.AnimationId = 0 -- replace "0" with animation Id

local Idle2 = Animate:WaitForChild('idle'):WaitForChild('Animation2') -- Looking Around
Idle2.AnimationId = 0 -- replace "0" with animation Id

end)
Ad

Answer this question