Jump to content

[HELP]Level System (exp_system)


off

Recommended Posts

Anyone know to fix it? Not gaining experience.

WARNING: exp_system\server.lua:0: Bad argument @ 'addPlayerEXP' [Expected player element at argument 1, got 54] 

Server.lua:

addEventHandler("onPlayerWasted",root, 
function (_,killer) 
if (killer and killer ~= source) then 
        exports.exp_system:addPlayerEXP(killer,25) 
    end 
end) 

Edited by Guest
Link to comment
Not really sure why your code isn't working, but you can try this one:
addEventHandler ( "onPlayerWasted", root, function ( _, p ) 
    if ( p and isElement ( p ) and p ~= source ) then 
        exports['exp_system']:addPlayerEXP ( p, 25 ) 
    end 
end ) 

I could not test it yet, but seems to be functional.

Make sure you have the correct syntax in your meta file for exports.

Está lá...

  
<export function="exports.exp_system" type="server" /> 
<export type="server" function="addPlayerEXP" /> 
  

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...