I was trying to prgram some BackLights for a car, but the Lights won’t turn on even when I tell it when the throttle is 1, -1, or 0. Is there something wrong with my code?
local BackLight = script.Parent.BackLight --------------- BackLight Function
local BackLight2 = script.Parent.BackLight2
local Vehicle = script.Parent.VehicleSeat
local Throttle = Vehicle.Throttle
while true do
wait()
if Throttle == 0 then
BackLight.BrickColor = BrickColor.new("Really red")
BackLight.Material = Enum.Material.SmoothPlastic
BackLight2.BrickColor = BrickColor.new("Really red")
BackLight2.Material = Enum.Material.SmoothPlastic
BackLight.SpotLight.Enabled = false
BackLight2.SpotLight.Enabled = false
end
if Throttle == 1 then
BackLight.BrickColor = BrickColor.new("Really red")
BackLight.Material = Enum.Material.SmoothPlastic
BackLight2.BrickColor = BrickColor.new("Really red")
BackLight2.Material = Enum.Material.SmoothPlastic
BackLight.SpotLight.Enabled = false
BackLight2.SpotLight.Enabled = false
end
if Throttle == -1 then
BackLight.BrickColor = BrickColor.new("Really red")
BackLight.Material = Enum.Material.Neon
BackLight2.BrickColor = BrickColor.new("Really red")
BackLight2.Material = Enum.Material.SmoothPlastic
BackLight.SpotLight.Enabled = true
BackLight2.SpotLight.Enabled = true
end
end