local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
On = false
--ANIMATIONS--
local pushupanim = Instance.new("Animation")
pushupanim.AnimationId = "http://www.roblox.com/asset/?id=316736671"
local jumpanim = Instance.new("Animation")
jumpanim.AnimationId = "http://www.roblox.com/asset/?id=316760136"
mouse.KeyDown:connect(function(key)
if key == "h" then
local playAnim = humanoid:LoadAnimation(pushupanim)
playAnim:Play()
humanoid.WalkSpeed = 0
On = true
elseif key == "h" and
On == true
then
local playAnim = humanoid:LoadAnimation(pushupanim)
playAnim:Stop()
humanoid.WalkSpeed = 16
end
end)
It's supposed to play on H and stop if pressed again, but it only plays it and when I press it again it just plays again.
