• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

On sight,

Status
Not open for further replies.

Lightning Blade

BETA Tester
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
 

Tommy

Founder
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:

Code:
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)
    end
end

RegisterCreatureEvent(30000, 27, TeleportLOS)
 

Tommy

Founder
Glad it works perfectly. I figured it would, but I had to go afk so I couldn't test it. :D
 
Status
Not open for further replies.
Top