As roblox moves away from its vestiges of default behavior, there is currently only one way to prevent a player from jumping out of a seat when they press the space bar: Don’t use Seat objects.
My vehicles used to rely on this behavior being overridden when the seat’s Disabled property was set to true (Seat:Sit(humanoid) would still work, but space bar would not jump the players out of the seat).
Recently, this behavior has changed. Now, regardless of anything (whether the Jumping state is enabled, whether it is immediately set to false), if the player hits space bar, they will jump out of the seat.
I recently made a workaround where I would re-seat the player if the Occupant property changes. However, as of a few days ago, this will crash the client, because now Seat:Sit(humanoid) will no longer re-seat the player if they player has just jumped out of the seat. This results in an infinite signal loop. Even waiting a Stepped tick before re-seating the player will not work, because I think the internals have changed to where the seat debounce is active for the Seat:Sit method
Making custom seats is fairly taxing and not as easy to copy roblox’s normal seating behavior. But it’s my only option at this point.
I think there should be a property of Seat objects that allows this jumping behavior to be overridden. As well as this, I don’t think the jumping debounce should be affecting the Sit function.
Personally, I’ve found that creating my own vehicle seat was a much better approach. At the time I set out for doing so, GetPropertyChangedSignal wasn’t out yet. So I actually used Changed. But once GetPropertyChangedSignal came out I was able to better optimize my code. Therefore if you really need custom functionality on a seat. I recommend making your own.
Note: The debounce and crash only happen when this is done from the client. If done from the server, it should work as expected.
The crash will definitely be fixed, as will the debounce on Sit. As for your approach on preventing players from exiting seats, a property would probably not be the best way to control this. Adding bool toggles for optional behavior creates API bloat over time. In this case, you should just kill the jump keybind clientside while the player is sitting:
You can unbind “LockSeat” when the player is removed from the seat via Lua or you’d like to give them the ability to exit themselves. This is preferable to disabling jumping, as jumping may not always be tied to seats (i.e. the jump keybind exits the seat, but it doesn’t actually make the character jump).