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:

1local Timetowait = 1
2while wait(Timetowait) do
3    if script.Parent.SpotLight.Enabled == true then
4        script.Parent.SpotLight.Enabled = false
5    else
6        script.Parent.SpotLight.Enabled = true
7    end
8end
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