Page 1 of 1

Weird Code Error

Posted: Sat Jan 17, 2015 11:55 am
by Rax
Okay, I'm trying to work on a mod, but constantly getting errors.
Error: "__[modname]__\control.lua:18:'then' expected near '='."

And my code is, on the 18th line, with before & after.

Code: Select all

if game.peacefulmode = true then
  game.showmessagedialog{text={"Peaceful mode enabled, have fun with infinite resources!"}}
Yes, I don't have anything before the if statement.

Re: Weird Code Error

Posted: Sat Jan 17, 2015 1:20 pm
by FishSandwich
Try:

Code: Select all

if game.peacefulmode == true then
game.showmessagedialog{text={"Peaceful mode enabled, have fun with infinite resources!"}}
end

Re: Weird Code Error

Posted: Sat Jan 17, 2015 7:35 pm
by Rax
FishSandwich wrote:Try:

Code: Select all

if game.peacefulmode == true then
game.showmessagedialog{text={"Peaceful mode enabled, have fun with infinite resources!"}}
end
BTW, FishSandwich, I love your Colobot videos. They made me start playing again :)