Quote:
Originally Posted by Cubical
class
PHP Code:
function addExp(amount){
clientr.exp += amount;
}
baddy
PHP Code:
join("player_functions");
function onActionServerside(cmd){
switch (cmd){
case "addexp":
addExp(amount);
break;
}
}
//#CLIENTSIDE
function onCheckDead(){
// do checks
triggerserver("gui", name, "addexp");
}
However joining the player to the class on login could simplify it and make it a bit more accessible. Using the same class you can just do player.addExp(amount); anywhere serverside by doing this on login.
PHP Code:
player.join("player_functions");
then your code would look like this
PHP Code:
function onActionServerside(cmd){
switch (cmd){
case "addexp":
player.addExp(amount);
break;
}
}
//#CLIENTSIDE
function onCheckDead(){
// do checks
triggerserver("gui", name, "addexp");
}
|
Hmm where would I put the exp because the baddy uses this.exp