How can I disable the ability to leave a seat?

Trying to disable the ability for a player to jump out of a seat. I tried setting jump power to 0.

4 Likes

Try using Humanoid.Jumped and in the function use :Sit() to make them sit on the seat again.

1 Like

Set JumpHeight to 0. This can be located in the Humanoid.

1 Like

Doesn’t work. When I press spacebar my character falls out of the seat.

1 Like

It worked when I tried it, I’m not sure why it’s not working for you.
Alternatively, you can either weld/anchor them or unbind the action temporarily.

Check out these posts:

They involve methods other than Jump Power (for the 2nd see the reply on SetStateEnabled). Are they of any help?

1 Like

Maybe you could just anchor the player’s HumanoidRootPart after they sit

1 Like

got this from another post maybe this will help:

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)

(mods dont take this down)

3 Likes

That’s legit what I was just about to say lol

Great minds think alike

I found the issue, another script was causing the issue.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.