I am trying to make this work until the BoolValue's value is changed to false, but it keep's crashing my studio even with a wait. Can someone tell me how to fix it?
Here is the code.
val = script.Parent.on -- BoolVaue
g1 = script.Parent.G1 -- Model
val.Changed:connect(function()
if val.Value == true then
repeat until val.Value == false
wait(0.02)
for _,v in pairs(g1:GetChildren()) do
if v.Name == "Light" then
v.Point.Enabled = true
v.Lighto.Enabled = true
wait(0.02)
v.Point.Enabled = false
v.Lighto.Enabled = false
wait(0.02)
end
end
end
end)

2 comments
Thanks.
Yup