✓ Accepted answer
So, put a ServerScript in the seat that you want it work in.
And write this, I'll explain the code under it.
local currentChar
script.Parent:GetPropertyChangedSignal("Occupant"):Connect(function()
if script.Parent.Occupant ~= nil then
local occupant = script.Parent.Occupant
currentChar = occupant.Parent
currentChar.Humanoid.WalkSpeed = 0
elseif script.Parent.Occupant == nil then
currentChar.Humanoid.WalkSpeed = 16
end
end)
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!
2 comments
@killerbrenden That wouldn't fit my needs, I want to set the player's walkspeed once they are teleported to the seat, and set it back to normal once they sit.
It's also removed, as I last used Seats I remembered you being able to do that.