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

How can i change the default idle and walk animation when equipping a tool?

Asked by
Sorukan 240 Moderation Voter
4 years ago
Edited 4 years ago

One method i tried was to use RenderStepped and constantly check if the player is moving or not, then i'll change the animation accordingly. However, this doesn't work for what i'm trying to accomplish because RenderStepped won't play the full animation.

Another method i tried was the change the Animate local script that is inserted into the character model by default like so

--//Equipped
tool.Equipped:Connect(function()    

char:WaitForChild('Animate').walk.WalkAnim.AnimationId = Walk.AnimationId -- the animation i want to change it to   

end)

This directly changes the Animation ID of the default animations but it doesn't seem to work.

1 answer

Log in to vote
0
Answered by 4 years ago

Try inserting an Animation inside the local script. then try and do

local tool = script.Parent
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()

tool.Equipped:connect(function()
local idleanim = char.Humanoid:LoadAnimation("Animation") -- or the name of the animation
idleanim:Play()

this should work for being idle but Im not sure about movements, hope this helped a bit.

Ad

Answer this question