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 3 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>

if workspace.Meltdown.Alarm.Playing == true
then

    print ("PointLight Flash 1 Enabled!")
    while true do
script.Parent.Color = Color3.new (255, 0, 0)
wait(0.2)
script.Parent.Color = Color3.new (255, 255, 255)

end

2 answers

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

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

if workspace.Meltdown.Alarm.Playing == true then

 print ("PointLight Flash 1 Enabled!")
while true do
script.Parent.Color = Color3.new (255, 0, 0)
wait(0.2)
script.Parent.Color = Color3.new (255, 255, 255)
end

end

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 — 3y
0
Also make sure to accept this answer! SilentsReplacement 468 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Hi coolgamingguyYT!

Try something like this:

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

Hope I helped!

Answer this question