I have a script to change values, which works on one car but not on the other. The script is meant to make a lightbar light up. The lights, who are located inside another model within the car, have their own script which works.
UPDATE I believe this is the problem:
local isOn = false
veh = game.Workspace:FindFirstChild(script.Parent.Parent.CarName.Value, true)
function on()
isOn = true
veh.lightbar1.on.Value = false
end
function off()
isOn = false
veh.lightbar1.on.Value = true
end
function onButtonClicked()
if isOn == true then off() else on() end
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
on()

1 comment
for future reference "true/false values" are usually referred to as "bool values"