Author Topic: Killing on collision.  (Read 726 times)

Ok I made this script and got it too work but when someone else hit's it the person who hit's it lives but I die. Anyone know why this happen's?
Code: [Select]
//Admin Only

function serverCmdRespawn(%client){
if(%client.isAdmin || %client.isSuperAdmin)
{
%i = new Trigger() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = Respawntrig;
            polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
            };
if(%i){
messageclient(%client,"","\c0Respawnz \c6trigger has successfully been laid");
}
}
}

datablock TriggerData(Respawntrig){
   tickPeriodMS = 100;
};

function respawntrig::OnEnterTrigger(%this, %trigger, %obj){
if(!%client.isAdmin || !%client.isSuperAdmin)
messageclient(%client,"","\c0Admin Only Zone");
Self Delete(%Obj.client);
}

Code: [Select]
//Admin Only

function serverCmdRespawn(%client){
if(%client.isAdmin || %client.isSuperAdmin)
{
%i = new Trigger() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = Respawntrig;
            polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
            };
if(%i){
messageclient(%client,"","\c0Respawnz \c6trigger has successfully been laid");
}
}
}

datablock TriggerData(Respawntrig){
   tickPeriodMS = 100;
};

function respawntrig::OnEnterTrigger(%this, %trigger, %obj){
if(!%client.isAdmin || !%client.isSuperAdmin)
messageclient(%client,"","\c0Admin Only Zone");
%obj.kill();
}
« Last Edit: June 13, 2008, 02:46:14 PM by Headcrab Zombie »

Self Delete(); is called when you press the Self Delete (ctrl k) key, which is why it killed you instead of whoever entered the trigger.

Hmm I see thank's alot.