ClearSitting

Constructor:

ClearSitting()

Description

Makes an avatar exit Ride state.

Examples

Create a part and a seat. When the avatar touches the part, make the avatar sit in the seat.

local part = RWObject.Create("Part") -- create a part
part.Position = Vector3.New(2,1,2)
part.Parent = WorkSpace
local seat = RWObject.Create("Seat") -- create a seat
seat.Position = Vector3.New(3,1,3)
seat.Parent = WorkSpace
part.CollisionEnter:Connect(function(hit) -- make the avatar equipped with the tool when touching the part.
    coroutine.start(function()
        if hit:IsClass("Avatar") then
            seat:Sit(hit) -- make the avatar sit in the seat
            coroutine.wait(2) -- wait 2 seconds
            seat:ClearSitting() -- make the avatar exit Riding state
        end
    end)
end)