PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Seated

This event fires when a Humanoid either sits in a Seat or VehicleSeat or gets up.

When a Player/Character comes into contact with a seat they are attached to the seat and a sitting animation plays. For more information on this, please see the Seat page.

The active parameter will be true if a player has sat down, and false if they have gotten up. The currentSeatPart parameter will be the seat part the humanoid is sitting in if they are sat down, or nil if they have gotten up.

See also

  • You can check if a humanoid is currently sitting using the Humanoid/Sit property
  • You can also check the current humanoid seat part using the Humanoid/SeatPart property

Parameters

Name Type Default Description

True if the Humanoid is sitting down

The seat the Humanoid is sat in if it is sitting down


Code Samples


Finding a Player's Seat

The code below fires when the Players/LocalPlayer|LocalPlayer's Player/Character|Character sits down or stands up.

It should be placed inside a LocalScript parented to StarterPlayerScripts|StarterPlayer.StarterPlayerScripts.

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

humanoid.Seated:Connect(function(isSeated, seat)
	if isSeated then
		if seat then
			print ("The player is now sitting in the seat named "..seat.Name.."!")
		end
	else
		print("The player is no longer sitting!")
	end
end)