Jump to content




[lua] script problem

lua

3 replies to this topic

#1 robrecht

  • New Members
  • 4 posts

Posted 15 January 2013 - 05:04 AM

This is a par of the broken script, which i put seperate in a program.
if (a=0) and (b=0) and (c=0) then
break
elseif  (a~=0) and (b=0) and (c=0) then
c=60
b=60
a=(a-1)
elseif (c=0) and (b~=0) and (c~=0) then
c=60
b=(b-1)
else
c=(c-1)
end
When i run this it says: :1: ')' expected.
Please don't think im dumb and i did it correct here and i forgot a ')' in the script because i didn't. I've looked over it 1000 times i can't get whats wrong please help me. thanks

#2 crazyguymgd

  • Members
  • 139 posts
  • LocationUSA

Posted 15 January 2013 - 05:06 AM

Use == in your ifs. A single = is for assignments, double == is for comparisons.

#3 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 15 January 2013 - 05:07 AM

In if loops you are comparing to values with == not =. Therefor the fixed code would be this. = assigns them

if (a==0) and (b==0) and (c==0) then
break
elseif  (a~=0) and (b==0) and (c==0) then
c=60
b=60
a=(a-1)
elseif (c==0) and (b~=0) and (c~=0) then
c=60
b=(b-1)
else
c=(c-1)
end

EDit: Ninjaed

#4 robrecht

  • New Members
  • 4 posts

Posted 15 January 2013 - 05:12 AM

ooooow i'm not used to work with numbers instead of strings in variables!!! thanks so much! pretty stupid of me :/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users