My train system has an emergency brake function, so basically if it stops at a station, the brakes apply.
However it just stopped working, around the time I started building up my script, and there is no error?
local function emergencyBrake()
targettedThrottle = 0
targettedBrake = 0
Velocity = 0
RemoteClientEvent:FireServer("base", {action = "MovementUpdate", throttle = targettedThrottle, brake = targettedBrake})
end
coroutine.wrap(function()
while eBrakeActive == true do
emergencyBrake()
task.wait(.1)
end
end)()
Can anyone please provide some insight into this?
Edit: Also even without the coroutine it doesn’t work