


Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
#using scripts\shared\array_shared;
#using scripts\codescripts\struct;
/*
#####################
by: M.A.K.E C E N T S
#####################
Script:
Add to main in mapname.gsc
kdoors::init( );
Add to top of mapname.gsc
#using scripts\zm\kill_doors;
Add to zone file
scriptparsetree,scripts/zm/kill_doors.gsc
###############################################################################
Radiant:
trigger targers script brushmodel
targetname>totalkills
zombie_cost># of kills
script_flag>flag to set for zone
script brushmodel targets a struct (the brush will move to this origin - optional)
targetname will be auto#
target will be auto# matching structs targetname
structs targetname will also be auto# matching brushes target
###############################################################################
*/
#namespace kdoors;
function init()
{
level.totalkills = 20;
trigs = GetEntArray("totalkills","targetname");
array::thread_all(trigs, &SetupDoors);
}
function SetupDoors()
{
if(!IsDeflected(self.zombie_cost))
{
self.zombie_cost = level.totalkills;
}
self SetHintString("You must reach " + self.zombie_cost + " kills to open this door");
self SetCursorHint("HINT_NOICON");
self thread WaitForKills();
}
function WaitForKills()
{
self thread OperateDoor();
if(isdefined(self.scrpt_flag))
{
flag::init(self.script_flag);
}
while(1)
{
if(GetKills() >= self.zombie_cost)
{
self OperateDoor(true);
if(isdefined(self.script_flag))
{
flag::set(self.script_flag);
}
self Delete();
return;
}
wait(.1);
}
}
function GetKills()
{//not sure about this function, never go kills before
totalkills = 0;
players = GetPlayers();
for( i=0;i<players.size;i++ ){
if(isdefined(players[i].pers["kills"]))
{
totalkills += players[i].pers["kills"];
}
}
return totalkills;
}
function OperateDoor(open = false)
{
doors = GetEntArray(self.target,"targetname");
foreach(door in doors)
{
if(open)
{
door NotSolid();
door ConnectPaths();
door thread OpenDoor();
}
else
{
door DisconnectPaths();
}
}
}
function OpenDoor()
{
dest = self.origin + (0,0,80);
if(IsDeflected(self.target))
{
mystruct = struct::get(self.target, "targetname");
if(IsDeflected(mystruct))
{
dest = mystruct.origin;
}
}
if(isdefined(self.script_vector))
{
dest = self.origin + self.script_vector;
}
//play sound
//play fx
//change speed of door opening
self MoveTo(dest, 1);
}
trigger notify("trigger", self);