Not Steve Posted April 9, 2017 Share Posted April 9, 2017 Can anyone here that codes lua help me and tell me what I am doing wrong in my basic code as I am learning to do this kind of stuff <3 local age = 20 if age = 20 then print ("You're 20!") elseif age > 20 then print ("You're under 20") else age < 20 then print ("You're over 20") end I get this everytime [ERROR] lua/age.lua:2: 'then' expected near '=' 1. unknown - lua/age.lua:0 Link to comment Share on other sites More sharing options...
TheCryptozz Posted April 9, 2017 Share Posted April 9, 2017 Try and replace any '=' not assigning a value with '==' as '==' is equal to "is equal to." This is based off of my Java experience, so it may not be the same. I can explain in further detail in the PM System if you choose. (If I am correct, of course...) Link to comment Share on other sites More sharing options...
CuddlyKraken @Twitch Posted April 9, 2017 Share Posted April 9, 2017 Clearly your lua age is the same amount as your lua experiance 0. JK love you steve. I have no idea bud I am the dumbest person alive when it comes to coding. If ever need some advice on smite let me know. I'm your man. Link to comment Share on other sites More sharing options...
Not Steve Posted April 9, 2017 Author Share Posted April 9, 2017 I am just stuck because I'm doing everything right to my knowledge, but it keeps giving me that error. Love you Kraken <3 Link to comment Share on other sites More sharing options...
TheCryptozz Posted April 9, 2017 Share Posted April 9, 2017 Try this: local age = 20 if age == 20 then print ("You're 20!") elseif age > 20 then print ("You're under 20") else age < 20 then print ("You're over 20") end Link to comment Share on other sites More sharing options...
Not Steve Posted April 10, 2017 Author Share Posted April 10, 2017 for k, v in pairs( player.GetAll() ) do if ( v:Alive() ) then print("you are alive") elseif (v:Alive() ) == false then print("you died") end end Can anyone identify what this does? I have just coded it and it works ;) NO CHEATING AND COPY/PASTE IT INTO CONSOLE! Link to comment Share on other sites More sharing options...
HotShot26 Posted April 10, 2017 Share Posted April 10, 2017 for k, v in pairs( player.GetAll() ) do if ( v:Alive() ) then print("you are alive") elseif (v:Alive() ) == false then print("you died") end end Can anyone identify what this does? I have just coded it and it works ;) NO CHEATING AND COPY/PASTE IT INTO CONSOLE! I do not code lua but I assume it says you are dead or alive? Link to comment Share on other sites More sharing options...
Not Steve Posted April 10, 2017 Author Share Posted April 10, 2017 for k, v in pairs( player.GetAll() ) do if ( v:Alive() ) then print("you are alive") elseif (v:Alive() ) == false then print("you died") end end Can anyone identify what this does? I have just coded it and it works ;) NO CHEATING AND COPY/PASTE IT INTO CONSOLE! I do not code lua but I assume it says you are dead or alive? Shhhh <3 Ill +1 your rep for answering that good xD Link to comment Share on other sites More sharing options...
Blacnova Posted April 10, 2017 Share Posted April 10, 2017 What are you using to learn? This is fairly simple. Link to comment Share on other sites More sharing options...
Not Steve Posted April 10, 2017 Author Share Posted April 10, 2017 I am trying to use the Wiki. The reason why I'm getting so happy is cause for some reason on the wiki, after the basic if, elseif, else it seems to throw in a ton of stuff I have no idea what I am typing, and this is the first line of code I did without help lol. If you have any links I can really learn off of for this, then PLEASE provide them. Link to comment Share on other sites More sharing options...
Recommended Posts