Jump to content

Problems With Level System


capitanazop

Recommended Posts

hi i create a level system for a rpg mode and in this gamemode works great! and have the same errors but only in the start of mode and after dont have problems but with my gamemode against all, zombies script, and in another resource

dont work and get many errors.

function levelUp (dataName)
local EXP = getElementData(source,"experience")
if (EXP > 80 and EXP < 180) then
outputChatBox("you are level 2 whit " .. tostring(EXP), source)  -- output this message together with the money
setElementData( source, "level", 2); 	
else
-- nothing : D
end

and the errors

[11:43:20] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:21] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:22] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:23] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:23] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:23] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:24] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:24] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:25] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:25] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:25] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:26] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:27] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:27] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:27] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:27] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean
[11:43:27] ERROR: ...dreas/server/mods/deathmatch/resources/level/lvl.lua:32: attempt to compare number with boolean

the line 32 is:

if (EXP > 80 and EXP < 180) then

i have another comand for check my exp and in my rpg gamemode says te exp perfectly but here say only "false"

any idea what is the problem?

bye and sorry for the english

Link to comment

EXP having the value false could be caused by

-source not existing at all

-source's element data "experience" not being set yet

and what is dataName, it seems unused? it would be pretty useful to know when your levelUp function is called, by what and client or server side

EDIT: reading your post again it makes now even less sense? what does work? when does it work? does it work at all? you don't make your problem clear

Link to comment

a friend help me and finally its work without errors :D

function levelUp (dataName)
local EXP = getElementData(source,"experiencia") 
if dataName == "experiencia" then
 
if (EXP > 80 and EXP < 180 ) then
outputChatBox("Eres Level 2 con " .. tostring(EXP), source)  -- output this message together with the money
setElementData( source, "level", 2); 	
 
end

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...