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

How would I stop an anim if the player sits down? [Solved]

Asked by 4 years ago
Edited 4 years ago

Hey there I know that this may seem simple to a lot of you but for some reason despite being an average coder i can't do this right now.

I have this animation played on click but i don't know how to stop the anim if the player sits down I tried a few things like while loops and if statements i just don't know what to do please help :) Btw the script and anim are children of a button gui.


local player = game.Players.LocalPlayer local character = player.Character repeat wait() character = player.Character until character local hum = character:WaitForChild("Humanoid") local emote = hum:LoadAnimation(script.Parent.Emote) playing = false script.Parent.MouseButton1Click:connect(function() if playing == false then if game.Players.LocalPlayer.Character.Humanoid.Sit == false then emote:Play() hum.WalkSpeed = 9 hum.JumpPower = 0 playing = true end elseif playing == true then emote:Stop() hum.WalkSpeed = 16 hum.JumpPower = 50 playing = false end end)
0
Thanks JesseSong I never knew that Humanoid.Seated was something you could do :) koviddev 29 — 4y

Answer this question