• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua attempt to compare number with nil

cire2003

New Member
Joined
May 31, 2008
Messages
29
Reaction score
0
i been trying to make a script that would make stop ppl from lvling once they reach a level X till they do a certain quest. did this below but i keep getting "attempt to compare number with nil"

Code:
if(getPlayerStorageValue(cid, 9996) == -1 and newlevel >= 250) then
			doCreatureSay(cid, "Congratulation on reaching this level. Go above Refugia depot to do the quest that you need to unlock further level.", TALKTYPE_ORANGE_1)
            	        setPlayerStorageValue(cid, 9996, 1)
			PlayerSetStorageValue(cid, queststorage, 1)
			PlayerSetExperienceRate(cid, 0.0)
end

i tryed that as well as this getPlayerStorageValue(cid, 9996) ~= 1 and this getPlayerStorageValue(cid, 9996) == NULL

with the == NULL i wouldnt get error message but it wouldnt do the script after
 
newlevel was nil.

1247493250792.jpg
 
Back
Top