View Full Version : On sight,

Lightning Blade
11-04-2013, 06:37 PM
Would there be any way to make a invisible npc or gameobject doesn't really matter what it is or if it's invisible, what it would do is, whenever a player is in a specific range it would teleport them to a location.

I'm not really sure how i would do this i have been looking through the wiki

11-04-2013, 06:51 PM
To make the NPC a 'trigger', change it's flags_extra to 128. http://collab.kpsn.org/display/tc/creature_template#creature_template-flags_extra

Now, to make him teleport a player once they are near;

Needed Hook:

CREATURE_EVENT_ON_MOVE_IN_LOS = 27, (event, creature, unit)

Once the player moves into LOS within the creatures distance you make it check for:

function TeleportLOS(event, creature, target)
if (creature:GetDistance(target) <= 15) then -- 15 is the [float] radius, change it to whatever you feel comfortable with
target:Teleport(0, 3000, 3000, 3000, 3000)

RegisterCreatureEvent(30000, 27, TeleportLOS)

Lightning Blade
11-04-2013, 06:55 PM
Thanks a lot

Lightning Blade
11-04-2013, 07:24 PM
perfect i fuuu****ng luv you <3

11-04-2013, 07:29 PM
Glad it works perfectly. I figured it would, but I had to go afk so I couldn't test it. :D

Lightning Blade
11-04-2013, 07:43 PM