Hi, im making a script add-on and I'm getting a syntax error for 'line 45' which is the for loop part. The ## is the part where the console command marked the syntax error.
Basically it rolls up to 3 random names.
function serverCmdRollName(%client, %amount) {
if(getSimTime()-%client.lastCooldownDice < $pref::Server::DiceCooldown) {
messageclient(%client, '', "<color:DDDDDD>You have to wait!");
return;
}
%client.lastCooldownDice = getSimTime();
%people = ClientGroup.GetCount()-1;
%amount = %amount < 1 ? 1 : (%amount > 3 ? 3:%amount);
%min = 0;
%max = %people;
for(%i = 0; %i < %amount; ##i++)
{
%num = getRandom(0, %people);
if(%list $= "")
%list = "<color:ff0000>"@%num;
else
%list = %list@"\c6, <color:ff0000>"@num;
}
messageAll('', '<color:D20000>%1<color:DDDDDD> has rolled <color:ff0000>%2<color:DDDDDD>!', %client.getPlayerName(), %list);
}
The code seems fine though, why is my console command doing this?