Advertisement
derkoch

Hero teleport with trigger

Aug 11th, 2014
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. function OnStartTouch(trigger)
  2.     -- Get the position of the "point_teleport_spot"-entity we put in our map
  3.     local point =  Entities:FindByName( nil, "point_teleport_spot" ):GetAbsOrigin()
  4.     -- Find a spot for the hero around 'point' and teleports to it
  5.     FindClearSpaceForUnit(trigger.activator, point, false)
  6.     -- Stop the hero, so he doesn't move
  7.     trigger.activator:Stop()
  8.     -- Refocus the camera of said player to the position of the teleported hero.
  9.     SendToConsole("dota_camera_center")
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement