Ok, my last one got taken down for some reason, anyways let me be more CLEAR.
I changed it up a little bit, and this is a Local Script in the Players PlayerGui.
01 | plr = game.Players.LocalPlayer |
02 | playr = script.Parent.Parent |
03 | char = plr.CharacterAdded:wait() |
04 | local player = workspace:findFirstChild(playr.Name) |
05 | local humanoid = player.Character.Humanoid |
06 |
07 | player.Ankles.Changed:connect( function () |
08 | if player.Ankles.Value = = 100 then |
09 | local anim = Instance.new( "Animation" ,char) |
10 | anim.AnimationId = "http://www.roblox.com/asset/?id=529177665" |
11 | local playAnim = humanoid:LoadAnimation(anim) |
12 | playAnim:Play() |
13 | script.Sound:Play() |
14 | wait( 3 ) -- How long until they get back up |
15 | script.Sound:Stop() |
16 | player.Ankles.Value = 0 |
17 | end |
18 | end ) |
I don't know where the problem is, and it doesnt show it in output. Please Help?
If you don't know the issue then we can't know either. Explain what are "Ankles", what is supposed to happen, what does not happen, what you have tried, context, etc. However I have done what can to make the script more safe and practical.
01 | --define variables safely |
02 | local player = game.Players.LocalPlayer |
03 | local char = player.Character or player.CharacterAdded:wait() |
04 | local humanoid = char:WaitForChild( 'Humanoid' ) |
05 | --assuming "Ankles" is inside the character... |
06 | local ankles = char:WaitForChild( 'Ankles' ) |
07 |
08 | --you only need to create one anim |
09 | local anim = Instance.new( "Animation" ) |
10 | anim.AnimationId = "http://www.roblox.com/asset/?id=529177665" |
11 |
12 | ankles.Changed:connect( function () |
13 | if ankles.Value = = 100 then |
14 | humanoid:LoadAnimation(anim):Play() |
15 | script.Sound:Play() |
16 | wait( 3 ) -- How long until they get back up |
17 | script.Sound:Stop() |
18 | ankles.Value = 0 |
19 | end |
20 | end ) |