How to make a Player Stand when Sitting in a seat?

I have tried this but the seat is not changing the animation.

(seat = script.Parent) and (animation = script.animation)

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    hit.Parent.Humanoid.Seated:Connect(function()
        local animationtoplay = hit.Parent.Humanoid:LoadAnimation(script.Animation)
        animationtoplay:Play()
        local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
        while wait() do
            if Player.Character.Humanoid.SeatPart == nil then
                animationtoplay:Stop()
            end
            end
        end)
    end
end)

instead of script.Animation try script.Parent.Animation as im assuming the animation and script are childs for the seat

You can set Humanoid.Sit to false in order to force the player out of the seat. If this isn’t what you’re looking for, could you elaborate on what you are trying to achieve?

I’ve used this seat for a while now, it allows you to set all your joint angles if you are using the R6 humanoid as well as the sitting position.

1 Like