Adding a win-condition
function Coin::onCollision(%this, %obj, %col, %vec, %len) {
%obj.delete();
if (Coins.getCount() <= 0) {
commandToClient(%col.client, 'ShowVictory');
}
}function clientCmdShowVictory()
{
MessageBoxOK("You Win!",
"Congratulations you found all the coins!",
"disconnect();" );
}A short note on client vs server scripts
Last updated