![]() |
Problem with exp gain and leveling up
I have an issue with leveling up in my script. When you kill a player it adds exp to you account with a script:
PHP Code:
Level 1 = 0 exp - 199 exp Level 2 = 200 exp - 399 exp Level 3 = 400 exp - 799 exp How could I get it to change the level of the player, which is stored as clientr.level, when the player has anywhere between two numbers with out listing everything out like PHP Code:
|
Something like this?
PHP Code:
|
This is a very common script.
Here's my bare-bones for an EXP system: Class: expfunctions PHP Code:
PHP Code:
player.addEXP(int(random(0, 100))); Then on the client-side you can use clientr.exp, clientr.explevel, and clientr.expneeded to display on your GUIs. Also regarding your use of: findplayer(player.account) If you have access to the player's account like that just use: player instead. |
Is 'random' (0,100) the range of numbers from 0-100? I can't find any documentation on this!
|
Quote:
int(random(0,100)) - int 'floors' the value which means it will always return a number >= 0 and <= 99. |
Okay, Thanks guys for the help! All is working now.
|
| All times are GMT +2. The time now is 11:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.