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

Animation Plays When Value hits 0?

Asked by 8 years ago
Edited 8 years ago

Basically, I can't figure out how when a value hits 0, an animation loads into the player with the value that is 0. This is all I have for now, and yes the Animation is mine but it doesn't play.

01local plr = script.Parent.Parent
02local char=plr.CharacterAdded:wait()
03local player=workspace:findFirstChild(plr.Name)
04local humanoid = player.Character.Humanoid
05 
06while wait() do
07    if plr.Ankles.Value <= 0 then
08local anim = Instance.new("Animation")
10        local playAnim = humanoid:LoadAnimation(anim)
11        playAnim:Play()
12        script.Sound:Play()
13            end
14    plr.Ankles.Value=100 -- How many times do they have to get crossed for them to fall
15end
0
why are you getting the player's character and then getting the workspace model? DaCrazyDev 444 — 8y
0
because "plr" is the one with the "Ankle" Value and the "player" is the one with humanoid to load the animation Resplendid 3 — 8y
0
it would be more clear if you used script blocks Coolboyok11 64 — 8y
0
well the thing is idk how :/ Resplendid 3 — 8y

Answer this question