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

I need help with my error, I don't know how to fix it. I'm pretty sure it's the line 2?

Asked by 4 years ago

Can anybody help, I don't know what's happened. Yesterday and long time ago it was functioning.

Error: 10:37:30.072 - Workspace.Part.PointLight.Script:10: Expected 'end' (to close 'then' at line 2), got <eof>

01if workspace.Meltdown.Alarm.Playing == true
02then
03 
04    print ("PointLight Flash 1 Enabled!")
05    while true do
06script.Parent.Color = Color3.new (255, 0, 0)
07wait(0.2)
08script.Parent.Color = Color3.new (255, 255, 255)
09 
10end

2 answers

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago

Hello there! You just missed an end for the while loop to close!

01if workspace.Meltdown.Alarm.Playing == true then
02 
03 print ("PointLight Flash 1 Enabled!")
04while true do
05script.Parent.Color = Color3.new (255, 0, 0)
06wait(0.2)
07script.Parent.Color = Color3.new (255, 255, 255)
08end
09 
10end

Make sure to up-vote and select this as your answer if it helped!

0
Oh wow, I really forgot one end. Delt_aaa 2 — 4y
0
Also make sure to accept this answer! SilentsReplacement 468 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Hi coolgamingguyYT!

Try something like this:

1if workspace.Meltdown.Alarm.Playing == true then
2    print("Pointlight Flash 1 Enabled!")
3    script.Parent.Color = Color3.new(255,0,0)
4    wait(0.02)
5    script.Parent.Color = Color3.new(255,255,255)
6end

Hope I helped!

Answer this question