zombie_teleport(){ triggerPlayer = getEnt("player_zombie_trigger","targetname"); triggerZombie = getEnt("zombie_zombie_trigger","targetname"); targetTeleport = getStruct("zombie_teleport_target","targetname"); while(1){ triggerPlayer waittill("trigger"); zombieArray = GetAIArray("axis"); for (i = 0;i<zombieArray.size;i++){ if(zombieArray[i] isTouching triggerZombie){ zombieArray[i] Teleport(targetTeleport.origin, (0,0,0)); iPrintLn("Zombie "+i+" has been teleported to origin: "+targetTeleport.origin); } } } }
How script works: 1) When player enters trigger multiple or uses trigger use with targetname "player_zombie_trigger" the script gets all zombies on the map 2) When zombies are touching the trigger multiple with targetname "zombie_zombie_trigger" they are being teleported to script struct with targetname "zombie_teleport_target" and the info what zombie has been teleported to the script struct and also gives info where is the struct appears Hope this helped. EDIT: You need to paste this into your map's gsc file and type thread zombie_teleport(); after maps\_zombiemode::main();
zombie_teleport(){ triggerPlayer = getEnt("player_zombie_trigger","targetname"); triggerZombie = getEnt("zombie_zombie_trigger","targetname"); targetTeleport = getStruct("zombie_teleport_target","targetname"); while(1){ triggerPlayer waittill("trigger"); zombieArray = GetAIArray("axis"); for (i = 0;i<zombieArray.size;i++){ if(zombieArray[i] isTouching triggerZombie){ zombieArray[i] Teleport(targetTeleport.origin, (0,0,0)); iPrintLn("Zombie "+i+" has been teleported to origin: "+targetTeleport.origin); } } } }
How script works: 1) When player enters trigger multiple or uses trigger use with targetname "player_zombie_trigger" the script gets all zombies on the map 2) When zombies are touching the trigger multiple with targetname "zombie_zombie_trigger" they are being teleported to script struct with targetname "zombie_teleport_target" and the info what zombie has been teleported to the script struct and also gives info where is the struct appears Hope this helped. EDIT: You need to paste this into your map's gsc file and type thread zombie_teleport(); after maps\_zombiemode::main();
Would a zombie use this to get closer to the players, as if it was the most direct way of getting to the them?
Last Edit: August 28, 2013, 12:04:56 pm by daedra descent