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 7 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.

local plr = script.Parent.Parent
local char=plr.CharacterAdded:wait()
local player=workspace:findFirstChild(plr.Name)
local humanoid = player.Character.Humanoid

while wait() do
    if plr.Ankles.Value <= 0 then
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=529177665"
        local playAnim = humanoid:LoadAnimation(anim)
        playAnim:Play()
        script.Sound:Play()
            end
    plr.Ankles.Value=100 -- How many times do they have to get crossed for them to fall
end
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