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

Trying to change animation of a player when they become a zombie, why isn't it updating?

Asked by 5 years ago
I am trying to make a script that will turn a player into a zombie, but the animation changes don't take effect at at all. What am I doing wrong here? The code is below:

if character then

local animate = character:WaitForChild("Animate")

character.Humanoid:RemoveAccessories();

if animate then

print("Animate script exists")

for _, playingTracks in pairs(character.Humanoid:GetPlayingAnimationTracks()) do

playingTracks:Stop(0)

end

animate.Disabled = true

animate.idle.Animation1.AnimationId = "rbxassetid://1113752682"

animate.idle.Animation2.AnimationId = animate.idle.Animation1.AnimationId

animate.walk.WalkAnim.AnimationId = "rbxassetid://1113750642"

animate.run.RunAnim.AnimationId = animate.walk.WalkAnim.AnimationId

animate.climb.ClimbAnim.AnimationId = "rbxassetid://1113754738"

animate.fall.FallAnim.AnimationId = "rbxassetid://1113751889"

animate.Disabled = false

end
0
You can write "Animation1" and "Animation2" it will not work beacause you are using numbers with strings, write idle["Animation1"].AnimationId iagometroid 61 — 5y
0
thats probarly because the character isnt a thing yet, it didnt load yet starmaq 1290 — 5y
0
make it into a :WaitForChild() starmaq 1290 — 5y
0
the first if statment starmaq 1290 — 5y
View all comments (3 more)
0
oh or you probarly already did it, nvm starmaq 1290 — 5y
0
Where is character being defined? vissequ 105 — 5y
0
Character is above it, I forgot to include it, the code is local character = game.Workspace:WaitForChild(player, 10) BmanGames 0 — 5y

Answer this question