Try to modify PointShop script

I have some errors like that: attempt to compare number with boolean.
script:



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


here is Calculate Level Price:



PS.Config.CalculateLevelPrice = function(ply, item)
	return item.Level
end


what is wrong?

[editline]29th August 2014[/editline]

error is here:



if not curlevel > level then LocalPlayer():SetNWBool("HasLevel", true) else LocalPlayer():SetNWBool("HasLevel", false) end


not it’s more powerful than >
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]

That works. Thank you :slight_smile:

Marking a post as solved helps.