when the player presses z they are seated and when they press x they play a standing up animation that leads into the idle animation
problem is the seated animation is looped and i don't know how to stop the Seated animation
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
local S = game.Workspace.Seated
S.AnimationId = "http://www.roblox.com/asset/?id=933369397"
local SU = game.Workspace.StandingUp
SU.AnimationId = "http://www.roblox.com/asset/?id=935753167"
mouse.KeyDown:connect(function(key)
if key == "x" then
local player S = humanoid:Animation(S)
S:Stop()
local playAnim = humanoid:LoadAnimation(SU)
playAnim:Play()
wait(2)
player.Character.Humanoid.WalkSpeed = 16
end
end)

1 comment
On line 14 it you needed to do local player = humanoid:LoadAnimation(S)