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

How do I see who if a player is sitting in a seat?

script.Parent.Occupant = ("humanoid") then
	print("lamp")
end

I am making a script to make the game do something when the player sits down? I am trying to make it work but it wont. I put a seat in a model and inserted a seat.Please help!

2 comments

0

Please look up your issue before addressing this forum.

0

I did nothing helped

2 answers

✓ Accepted answer

Please, visit this website before writing there a question. There you can find API-Reference, and it has an answer to your question, here. If you still not understand, there is an example:

workspace.Miniller.Humanoid.Seated:Connect(function(isSeated, seat)
	if isSeated then -- player is sitting
		print(seat.Name)  -- printing the object name where the player is sitting.
	end
end)

3 comments

0

or you can use game.Players.Miniller (of course with your name) instead of workspace.Miniller. Both works

1

Dude, Use Seat.Occupant.

1

It kind of worked the website helped! thank! you!

Just use

if plr.Character.Humanoid.Sit == true then
	--Stuff Here
end

NOTE: You have to define plr yourself EX: If the player's name is "RobloxGamer69", plr could be

game.Players.RobloxGamer69

Hope this helps!

1 comment

0

Though this works it’s a bit redundant. Use Seat.Occupent

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