Hello everyone, basically I have made a value called “Power” when this BoolValue is true, the lights need to be on. If its false, the lights are meant to be off. Although the issue is that.
I tried testing this with this here script to see if the value worked as intended
while true do
workspace.Values.Power.Value = false
wait(3)
workspace.Values.Power.Value = true
wait(3)
end
Although the light never changed.
This is the script I used for the lights.
while true do
if workspace.Values.Power.Value == true then
script.Parent.Light.PointLight.Enabled.Value = true
else
script.Parent.Light.PointLight.Enabled.Value = false
end
end
workspace.Values.Power.Changed:Connect(function()
if workspace.Values.Power.Value == true then
script.Parent.Light.PointLight.Enabled.Value = true
else
script.Parent.Light.PointLight.Enabled.Value = false
end
end)
Note: also i recommend using “task.wait()” instead of “wait()”
while true do
if workspace.Values.Power.Value == true then
script.Parent.Light.PointLight.Enabled = true
else
script.Parent.Light.PointLight.Enabled = false
end
end
workspace.Values.Power:GetPropertyChangedSignal("Value"):Connect(function()
if workspace.Values.Power.Value == true then
script.Parent.Light.PointLight.Enabled.Value = true
else
script.Parent.Light.PointLight.Enabled.Value = false
end
end)
It didnt work because he forgot to delete the .Value after the .Enabled again!
He meant to write this
workspace.Values.Power:GetPropertyChangedSignal("Value"):Connect(function()
if workspace.Values.Power.Value == true then
script.Parent.Light.PointLight.Enabled= true
else
script.Parent.Light.PointLight.Enabled= false
end
end)