How to detect if a humanoid sat on a seat

Hello, im trying to figure out a way to detect humanoid sitting to a seat can you help me figure out how

I tried several scripts but it did not work altough there is no errors in output

1 Like
local humanoid = 

humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
	if hum.Sit.Value == true then
		-- if they're sat
	else
		-- if they're standing
	end
end)
2 Likes

Thanks ill try the code and reply you back when I tested it

1 Like

If you want the seat detect humanoid sitting on it you could do

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
     local humanoid = Seat.Occupant -- Seats/vehicleseats can be occupied only by humanoids 
end)

or the other way round is the reply above me

1 Like

why is this empty, do you think it would work without detecting the humanoid

I made it empty so you can put where your humanoid is located there.

It is gonna be on workspace but I could not figure a way to locate it

Is it a local script or normal (server) script?

If it’s local, you can do game.Players.LocalPlayer.Character.Humanoid, however local scripts do not run in Workspace i think.

If it’s server, then you could do this…

game.Players.PlayerAdded:Connect(function(plr)
	wait(1)
	local humanoid = plr.Character.Humanoid

	humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
		if humanoid.Sit.Value == true then
			-- if they're sat
		else
			-- if they're standing
		end
	end)
end)
1 Like

None of these work, hmm I dont know why :thinking:

Are you trying to check it Server-Sided or Client-Sided?

Thank you for your time, I figured a way