Brolis Posted August 15, 2012 Posted August 15, 2012 (edited) ERROR: god\huh.lua:7: attempt to compare number with boolean addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local idiotkills = getAccountData(account,"Zombie kills") if (idiotkills >= 0) and (idiotkills <= 4) then setAccountData ( account, "Lolid", "Asshol" ) elseif (idiotkills >= 5) and (idiotkills <= 29) then setAccountData ( account, "Lolid", "Moran" ) elseif (idiotkills >= 30) and (idiotkills <= 79) then end end ) ) ) Edited August 16, 2012 by Guest
AMARANT Posted August 15, 2012 Posted August 15, 2012 Your account data returns false. So you're trying to compare some numbers with false.
AMARANT Posted August 15, 2012 Posted August 15, 2012 The data you want to retrieve from the database to compare with "zombiekills" value shouldn't be false. To avoid it you have to set it once in your script. You can do it like this: addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local idiotkills = getAccountData(account,"Zombie kills") if not idiotkills then setAccountData(account,"Zombie kills",0) idiotkills = 0 end if (idiotkills >= 0) and (zombiekills <= 4) then setAccountData ( account, "Lygis", "Asshol" ) elseif (idiotkills >= 5) and (idiotkills <= 29) then setAccountData ( account, "Lygis", "Moran" ) elseif (idiotkills >= 30) and (idiotkills <= 79) then end end ) ) )
Anderl Posted August 15, 2012 Posted August 15, 2012 (zombiekills <= 4) zombiekills is nil. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now