dashe123 Posted July 23, 2011 Share Posted July 23, 2011 Greetings. Internet is full of "kill and get exp" scripts but how do I make a script which gives exp for a player every minute for just running and driving? Link to comment
Mimimiguel Posted July 23, 2011 Share Posted July 23, 2011 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 Link to comment
Castillo Posted July 23, 2011 Share Posted July 23, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now