Oh I see.
So if his level is 23, to the computer his switch statement looks like this:
switch (1)
{
case 1:
%rank = "Youngling";
case 1:
%rank = "Initiate";
case 0:
%rank = "Padawan";
case 0:
%rank = "Knight";
case 0:
%rank = "Master";
case 0:
%rank = "Grand Master";
And the game leaves the switch statement at the first success.
Why not just reverse the order?
switch (1)
{
case %level>=750:
%rank = "Grand Master";
case %level>=500:
%rank = "Master";
case %level>=250:
%rank = "Knight";
case %level>=50:
%rank = "Padawan";
case %level>=20:
%rank = "Initiate";
case %level>=0:
%rank = "Youngling";
That way it will exit the switch as soon as it hits the highest rank the person qualifies for.
this looks awful backwards and confusing else if would be a far better option
if(%team $="jedi")
{
if %level>=750:
%rank = "Grand Master";
This doesnt seem right because I want it to check if there on team sith or team jedi
just add another if statement, and work on properly intending your code
like
if(%team $= "jedi")
{
if(%level < 20)
{
%rank = "youngling";
}
else if(%level < 50)
{
%rank = "initiate";
}
//more ranks here
}
else if(%team $= "sith lord")
{
//ranks here
}
also you may want to consider using variables on players or the client or something so these variables are persistent
ie
%client.team %client.level and then pass in a client or player on your function