• Is there a way to make my addon not teleport through walls?
    5 replies, posted
  • Avatar of Mchccjg12
  • I'm trying to make an addon that will teleport to the player and kill them when not being looked at, but I also do not want it to travel though walls (so if it is locked in a room and cannot normally get to the player, it won't be able to teleport). If I can't do that for teleporting, then could I do that for normal movement (sliding, I guess)? [highlight](User was banned for this post ("Wrong section" - Gran PC))[/highlight]
  • I dont fully understand what you mean, but i think just you just need to use trace to see if the two players can see each other.
  • Avatar of Mchccjg12
  • Sorry. I did word that a bit weird, didn't I? What I meant was, I want to code an object that will teleport to the player and kill them when they aren't looking in its direction. Is there a way to make it so that the object will not teleport to the player if it cannot reach them by normal means?
  • Then yeah, trace would be your best bet. Make it when the trace from the player to the object is broken the teleport happens. However for checking if its possible to get there via normal means then you would have to do some NPC pathfinding, ile try to find some wiki links later. Edit: Try this? [url]http://bananatree.im/wiki/wiki.garrysmod.com/indexc388.html?title=A-Star_Pathfinding_Module[/url]