raf
Active Member
I know what this thread title means but i just can't see in script what's wrong.
This is the error i get
Could you explain how is it trying to compare number with boolean ?
PHP:
function Player:getLoyaltyDescription(thing)
local check = db.storeQuery("SELECT `total_premium_points` FROM `accounts` WHERE `id` = " .. db.escapeString(thing:getGuid()))
local loyaltyTitle = ""
if ((check >= 0) and (check < 50)) then -- Line 593 that shows up in error.
loyaltyTitle = "Citizen"
elseif ((check >= 50) and (check < 100)) then
loyaltyTitle = "Scout"
elseif ((check >= 100) and (check < 200)) then
loyaltyTitle = "Sentinel"
elseif ((check >= 200) and (check < 400)) then
loyaltyTitle = "Steward"
elseif ((check >= 400) and (check < 1000)) then
loyaltyTitle = "Warden"
elseif ((check >= 1000) and (check < 2000)) then
loyaltyTitle = "Squire"
elseif ((check >= 2000) and (check < 3000)) then
loyaltyTitle = "Warrior"
elseif ((check >= 3000) and (check < 4000)) then
loyaltyTitle = "Keeper"
elseif ((check >= 4000) and (check < 5000)) then
loyaltyTitle = "Guardian"
elseif ((check >= 5000) and (check < 999999999)) then
loyaltyTitle = "Sage"
end
local descr = ""
if self == thing then
descr = descr .. " You are "
elseif thing:getSex() == PLAYERSEX_FEMALE then
descr = descr .. " She is "
else
descr = descr .. " He is "
end
descr = descr .. loyaltyTitle .. ' of Legendera.'
return descr
end
This is the error i get
PHP:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLook
data/global.lua:593: attempt to compare number with boolean
stack traceback:
[C]: ?
data/global.lua:593: in function 'getLoyaltyDescription'
data/events/scripts/player.lua:18: in function <data/events/scripts/player.lua:13>
Could you explain how is it trying to compare number with boolean ?
Last edited: