Expected 'then' when parsing if statement, got '=' how to fix it?

Hello i have problem i was scripting and i got this error and i dont know how to fix it. Can you help me please?

script:

if game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency = 0
then (“hotel has been saved”)

if game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency = 1
then print(“Hotel not saved!”)

you forgot to double the equal sign

if game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency == 0 then
print(“hotel has been saved”)
end

if game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency == 1 then
print(“Hotel not saved!”)
end

also could format this better if you put this instead:

if game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency == 0 then
print(“hotel has been saved”)
elseif game.Workspace.EventSystem.Event.Meteorite.Laser.LaserBeam.Transparency == 1 then
print(“Hotel not saved!”)
end

3 Likes

Thanks for help! Ur best :smiley: THX

1 Like

no problem (thjrty character limit aaaaaaaa)

1 Like