If you call a previously undefined variable, it will become whatever you want it to be. So if the first time $ubersummon is called it has no definition, and the call is $ubersummon++, it will assume it is a number, and that number is 0. In other words, you dont have to define it before you use it.
As for the if statement, You may want to use >= rather than ==. That will cover your butt in the event of a "just in case".
So:
$ubersummon = 0;
$LoadOut[TestBot] = "CLASS Paladin LVL 1050 LCK 3 TEAM 4 BroadSword 1";
function FunctionName(%clientId)
{
if($ubersummon >= 50)
$ubersummon = 0;
%player = Client::getOwnedObject(%clientId);
%clientpos = GameBase::getPosition(%clientId);
%length = 500;
$los::object = "";
$los::position = "";
if(GameBase::getLOSinfo(%player, %length))
{
%object = $los::object;
%objpos = $los::position;
%obj = getObjectType(%object);
if (%obj == "SimTerrain" || %obj == "InteriorShape")
{
%name = "UberSummon" @ $ubersummon++ ;
%newName = "Sloth";
%displayName = "UberSummon" @ %name;
%aiSpawnPos = %objpos;
%commandIssuer = "TempSpawn";
%loadout = "TestBot";
SpawnAI(%newName, %displayName, %aiSpawnPos, %commandIssuer, %loadout);
}
}
}
Or something like that.