hatch()
{
hatch = getent("luik","targetname");
trigger = getent("luiktrigger","targetname");
amount_of_seconds = 7;
while(1)
{
wait .05;
players = getentarray("player","classname");
for(i=0;i<players.size;i++)
{
if(!isDefined(players[i]) || players[i].pers["team"] == "spectator" || players[i].sessionstate != "playing")
continue;
time = 0;
hatch_notsolid = false;
while(isDefined(players[i]) && players[i].sessionstate == "playing" && players[i] isTouching(trigger) && !hatch_notsolid)
{
time += .05;
wait .05;
while(isDefined(players[i]) && players[i].sessionstate == "playing" && time >= amount_of_seconds && players[i] isTouching(trigger))
{
if(!hatch_notsolid)
{
hatch.origin += (0,0,10000);
hatch_notsolid = true;
}
wait .05;
}
}
hatch.origin -= (0,0,10000);
}
}
}