New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 3 months 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. Marineboy3O8 97 — 3mo
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 — 3mo

1 answer

Log in to vote
0
Answered by
Prestory 1390 Moderation Voter
3 months 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