Having issues with Seat. I have to use repeat until to make player sit

I have been working with seat for some time and it seems to not want to work how it’s intended to. The :Sit() method doesn’t work always, like most of the time, and i have to use a repeat to check until the player has sat. Is there a better way around this? I was thinking of using :PivotTo(). Please let me know suggestions.

use the Humanoid.Seated event

humanoid.Seated:Connect(function(boolean: seated,instance: seat)
 -- function here
end)

Case closed.

1 Like

i have that in place with a repeat loop

how about GetPropertyChangedSignal?

local Seat =  script.Parent -- path to seat

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Seat.Occupant ~= nil then
		local Char = Seat.Occupant.Parent
		Char["HumanoidRootPart"].Anchored = true
        -- Can also set their jump power if wanting, your preference
	end
end)

interesting. so i have it to where two players join a table and take ownership of one of the seats. the ownership logic is outside of this. but what happens is when a player is already sitting you can’t use :Sit() so you have to unseat them… and then :Sit() doesn’t always work the first time for some reason. how do you think this event would be useful for this logic?

Please show your code. This is scripting support, and we can’t help without a script.

I don’t think there’s a point of providing a script when there’s not a bug in the script and it’s the issue with how the :Sit() method works and how unseating the humanoid works. I feel like I explained things to the point where it would make sense to another programmer on the platform. You have to make sure a player is not seated before you use :Sit() but event then :Sit() isn’t bullet proof.

I am setting the seat property of the humanoid to false. – so that if they are sitting i can set them

I am using .Seated event to set a debounce of hasSit to true. – because :Sit() does not always work

I am using a repeat :Sit() until hasSit is equal to true. – because :Sit() does not always work

fyi this works. i’m just wondering if there’s a better method someone else has tried. because using loops to do this behavior is a bit much.

Do you want it so that the player is stuck in a seat? Can’t you just disable their jump?

no, that’s not what i want. i actually chose to stick with the loop until player has sit. am also setting states for the player to keep track of what they’re supposed to be doing. etc.