So, put a ServerScript in the seat that you want it work in.
And write this, I'll explain the code under it.
03 | script.Parent:GetPropertyChangedSignal( "Occupant" ):Connect( function () |
04 | if script.Parent.Occupant ~ = nil then |
05 | local occupant = script.Parent.Occupant |
06 | currentChar = occupant.Parent |
07 | currentChar.Humanoid.WalkSpeed = 0 |
08 | elseif script.Parent.Occupant = = nil then |
09 | currentChar.Humanoid.WalkSpeed = 16 |
This will check whenever the occupant value changes, and their is a variable that whenever a player is sitting on it, their character is referenced as currentChar
. Whenever they sit down, their walkspeed changes to 0, and whenever they get up, it get's set back to 16.
Hope this helped! Don't forget to select this as the answer if this worked for you!