Jump to content

Experience (score)


dashe123

Recommended Posts

look at this resource

https://community.multitheftauto.com/index.php?p= ... ls&id=1253

to grow a player level you have to use a function, so use it with a timer

setTimer(upgrade, 1000, 0 ) 
function upgrade( ) 
       for k, v in ipairs(getElementsByType( "players" ) do 
       data = getElementData( v, "exp" ) 
       giveexp = data + 10 
       setElementData(v,"exp",giveexp) 
       end 
end 

that should upgrade a level for every player every second :P

Link to comment
function upgrade( ) 
       for k, v in ipairs(getElementsByType( "players" ) do 
       data = getElementData( v, "exp" ) 
       giveexp = data + 10 
       setElementData(v,"exp",giveexp) 
       end 
end 
setTimer(upgrade, 1000, 0 ) 

setTimer has to be below the function.

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