..:D&G:.. Posted May 26, 2015 Share Posted May 26, 2015 Hello, I made this set wanted level function but I keep getting the error "Attempt to compare boolean with number". function setPlayerWanted(thePlayer, cmd, who, amountWanted) if isPlayerOwner(thePlayer) or isPlayerSuperMod(thePlayer) then if not (who) then outputChatBox("SYNTAXA: /"..cmd.." [Name] [Wanted]", thePlayer, 255, 255, 0) else local amountWanted = tonumber(amountWanted) local player = exports["(wG)Tools"]:findPlayer(who) if not amountWanted < 7 and not amountWanted > -1 then return else setElementData(who, "wantedPoints", amountWanted) end end end end addCommandHandler("setwanted", setPlayerWanted) Here is the error: if not amountWanted < 7 and not amountWanted > -1 then Even though I put a number when I type the command, and when I've defined "amountWanted" as a tonumber, it still reads it as a boolean... Any ideas what's wrong? Link to comment
ALw7sH Posted May 26, 2015 Share Posted May 26, 2015 if not amountWanted < 7 and not amountWanted > -1 then not amountWanted - return boolean if not ( amountWanted < 7 ) and not ( amountWanted > -1 ) then Link to comment
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