I'm trying to move a seat when I sit in it. My script isn't working, and isn't giving me an error message.
The following script is supposed to make the seat move by .25 studs every half a second when the script detects a Humanoid is sitting in the seat. The script is inside a seat.
local debounce = false
while true do
wait(.5)
if script.Parent.Occupant == "Humanoid" then
if debounce == false then
debounce = true
while true do
wait(.5)
script.Parent.Position = script.Parent.Position - Vector3.new(0,0,.25)
end
end
end
end

3 comments
It gave me an error :( "Workspace.Object.Seat.Script:4: attempt to index local 'LocalPlayer' (a nil value)"
Try now.
Yes it worked! Thank you so much