I just wan't to make this script smaller, because of my sloppy scripting i dont know how :p
--Detector for Veichle Seats
--ForwardChange(1)
script.Parent.VehicleSeat.Changed:connect(function()
if script.Parent.VehicleSeat.Throttle == 1 then
ForwardChange()
end
end)
--ForwardChange(2)
function ForwardChange()
script.Parent.Forward.BrickColor = BrickColor.new("Really red")
end
--ForwardChange(3)
script.Parent.VehicleSeat.Changed:connect(function()
if script.Parent.VehicleSeat.Throttle == 0 or -1 then
script.Parent.Forward.BrickColor = BrickColor.Black()
end
end)
--barr
--BackWardChange
script.Parent.VehicleSeat.Changed:connect(function()
if script.Parent.VehicleSeat.Throttle == -1 then
BackWardChange()
end
end)
--BackWardChange(2)
function BackWardChange()
script.Parent.Backward.BrickColor = BrickColor.new("Really red")
end
--BackWardChange(3)
script.Parent.VehicleSeat.Changed:connect(function()
if script.Parent.VehicleSeat.Throttle == 0 or 1 then
script.Parent.Backward.BrickColor = BrickColor.Black()
end
end)

1 comment
Well it doesn't have to be compact. The point of writing clean code is for the user to be able to read it. But I'll give it a shot xD