• Try to modify PointShop script
    3 replies, posted
I have some errors like that: attempt to compare number with boolean. script: [CODE] local level = PS.Config.CalculateLevelPrice(LocalPlayer(), self.Data) local curlevel = tonumber( LocalPlayer():GetNWInt( 'LVL' ) ) if not curlevel > level then LocalPlayer():SetNWBool("HasLevel", true) else LocalPlayer():SetNWBool("HasLevel", false) end [/CODE] here is Calculate Level Price: [CODE] PS.Config.CalculateLevelPrice = function(ply, item) return item.Level end [/CODE] what is wrong? [editline]29th August 2014[/editline] error is here: [CODE] if not curlevel > level then LocalPlayer():SetNWBool("HasLevel", true) else LocalPlayer():SetNWBool("HasLevel", false) end [/CODE]
[B]not[/B] it's more powerful than [B]>[/B] You are asking if curlevel exists, it's greater than level, and that causes that error [lua]if not (curlevel > level) then <do stuff> end[/lua]
[QUOTE=gonzalolog;45839527][B]not[/B] it's more powerful than [B]>[/B] You are asking if curlevel exists, it's greater than level, and that causes that error [lua]if not (curlevel > level) then <do stuff> end[/lua][/QUOTE] That works. Thank you :)
[QUOTE=Dezigl;45845027]That works. Thank you :)[/QUOTE] Marking a post as solved helps.
Sorry, you need to Log In to post a reply to this thread.