NPC Code:
// NPC made by Nyght
// Class Equilization
if (playerenters&&!joined) {
set joined;
setstring server.people,#v(strtofloat(#s(server.people))+1);
}
if (playerchats&&startswith(joinclass,#c)) {
this.warrior=strtofloat(#s(server.warrior))/strtofloat(#s(server.people));
tokenize #c;
if (strequals(#t(1),warrior)) {
if (this.warrior>0.3) {
message You can not choose this class because it allready has enough participants!;
sleep 1.25;
message ;
} else {
joinclasswarrior();
}
}
message If you are not transfered to class level, check spelling and try again!;
}
// Functions
function joinclasswarrior() {
set warriorclass;
setstring server.warrior,#v(strtofloat(#s(server.warrior))+1 );
setlevel2 warrior.graal,32,32;
}
This should work how you want it to.