Ok, but I have it close here like you said:
function servercmdstartDig(%client)
{
if(%client.bl_id != getNumKeyID() && findLocalClient() != %client)
{
messageClient(%client, '', "You are not the host so you cannot start dig mode");
return;
}
} <== Here is the closing one you told me to write.
$Dig_allowedMission["Slate"] = 1;
$Dig_allowedMission["Slate Aurora"] = 1;
$Dig_allowedMission["Destruct"] = 1;
$Dig_groundID["Slate"] = 5;
$Dig_groundID["Slate Aurora"] = 6;
$Dig_groundID["Destruct"] = 5;
if(!$Dig_allowedMission[missionInfo.name])
{
messageClient(%client, '', "Dig mode is only usable in Slate, Slate Aurora, and Destruct");
return;
}
$Dig_host = %client;
$Dig_host_brickgroup = %client.brickgroup;
$Dig_host_id = %client.bl_id;
deleteVariables("$Dig_placedDirt*");
%ground = missionGroup.getobject($Dig_groundID[missionInfo.name]);
if(missionInfo.name $= "Slate Aurora")
%water = missionGroup.getobject(7);
if(isObject(%ground))
%ground.delete();
if(isObject(%water))
%water.delete();
%spawnsphere = playerDropPoints.getobject(0);
%spawnsphere.radius = 5;
%spawnsphere.RayHeight = 3;
messageAll('', "<color:00FF00>Dig mode is now enabled");
for(%x = -5.5; %x <= 5.5; %x++)
for(%y = -5.5; %y <= 5.5; %y++)
{
Dig_PlaceCement(%x*2 SPC %y*2 SPC 0, "brick4xCubeData");
Dig_PlaceCement(%x*2 SPC %y*2 SPC 10, "brick4xCubeData");
}
%pos[0] = "10 10";
%pos[1] = "10 -10";
%pos[2] = "-10 10";
%pos[3] = "-10 -10";
for(%a = 0; %a < 4; %a++)
{
Dig_PlaceCement(%pos[%a] SPC 3, "brick8xCubeData");
Dig_PlaceCement(%pos[%a] SPC 7, "brick8xCubeData");
}
for(%z = 0; %z <= 3; %z++)
{
for(%x = 0; %x < 8; %x++)
Dig_PlaceDirt(-7 + %x*2 SPC 11 SPC 2+%z*2);
for(%y = 0; %y < 8; %y++)
Dig_PlaceDirt(11 SPC 7 - %y*2 SPC 2+%z*2);
for(%x = 0; %x < 8; %x++)
Dig_PlaceDirt(7 - %x*2 SPC -11 SPC 2+%z*2);
for(%y = 0; %y < 8; %y++)
Dig_PlaceDirt(-11 SPC -7 + %Y*2 SPC 2+%z*2);
}
%light = Dig_PlaceCement("0 0 8.75", "brick2x2FRoundData");
%light.setLight(PlayerLight);
activatepackage(Dig_spawnPackage);
for(%c = 0; %c < ClientGroup.getCount(); %c++)
if(ClientGroup.getObject(%c).hasSpawnedOnce)
ClientGroup.getObject(%c).instantRespawn();
Dig_announceStats();
$Dig_on = 1;
} <== Then, here is another closing one.