Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i detect if a player is occupying a seat in roblox?

1 answer

✓ Accepted answer

There is a property in a Seat called Occupant, and you can check whose Humanoid is in the seat

https://developer.roblox.com/en-us/api-reference/property/Seat/Occupant

Here is a sample script

local Seat = -- your seat
Seat.Occupant.Changed:Connect(function()
	if Seat.Occupant == nil then -- is there someone sitting there?
		print("someone left a seat")
	else
		local player = Seat.Occupant.Parent
		print(player.Name.." is sitting in a seat")
	end
end)

Hope that helps

1 comment

1

Thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.