Sit

Constructor:

Sit(humanoidObj)

Description

Makes the avatar enter riding state.

Parameters

Name Type Description
humanoidObj RWObject Specified avatar

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.
  if hit:IsClass("Avatar") then
   seat:Sit(hit) -- make the avatar sit in the seat
  end
end)