Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a loop?

Asked by 9 years ago

How do I make a loop for lights so every second they turn on, then off? Please help!
it comes up with this

SpotLight is not a valid member of Part

1 answer

Log in to vote
0
Answered by
DevArk 50
9 years ago

you would use a while loop:

local Timetowait = 1
while wait(Timetowait) do
    if script.Parent.SpotLight.Enabled == true then
        script.Parent.SpotLight.Enabled = false
    else
        script.Parent.SpotLight.Enabled = true
    end
end
0
You could use script.Parent.SpotLight.Enabled = not script.Parent.SpotLight.Enabled ISellCows 2 — 9y
0
Umm ok? SharkOwen_dev 69 — 5y
Ad

Answer this question