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

How to check if player/Humanoid is sitting?

I dont know about this. I am trying to make a see-saw in my game and I need it to sense when a player has got on. Would there be something like this?:

while true do
    wait(0.1)
    if game.Players.LocalPlayer.Character.Humanoid.Sitting == true then
        if game.Players.LocalPlayer.Character.Humanoid.Seat.Name == "SeeSaw1" then
            game.Players.LocalPlayer.PlayerGui.SeeSawGui.SeeSawButtons.Visible = true
        end
    end
end

Of course this did not work. Could someone show me how to do this? Thanks in advance!

2 comments

0

There is a sit properties in humanoid, maybe you can check by that propertiy ?

0

Is there? I have never noticed that. I will check it out if I get no answers.

1 answer

Humanoids actually have .Seated event which fires when a humanoid sits or gets up from a seat

--LocalScript
local plr = game.Players.LocalPlayer.Character

plr.Character.Humanoid.Seated:Connect(function(seated, seat) --Seated boolean, seat instance
	--code here
end)

The event records a boolean of whether they're sat or getting up, true and false respectively, and the seat which they sat in. I hope this helps you!

2 comments

1

So could I do if seated == true then if seat.Name == "SeeSaw1" then?

0

Absolutely.

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