Parts won't change Color in VehicleSeat!

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
local BackLight = script.Parent.BackLight --------------- BackLight Function
local BackLight2 = script.Parent.BackLight2
local Vehicle = script.Parent.VehicleSeat

while true do
	wait()
	if Vehicle.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 Vehicle.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 Vehicle.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

Throttle is not defined to be a property, he is defined to be a value

1 Like

Thank you so much! For some reason, I didn’t see that error!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.