Saana

swg_admintele.lua

Sep 26th, 2013
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. -- For server owners.
  2. -- Paste this into: lua/autorun/server, name it anything you like
  3. -- This script creates a teleport in the centre of the water tower which teleports admins to the admin room
  4.  
  5.     local function SearchForPlayer()
  6.     local pos = Vector(-348, 5196, 2661)
  7.     local tel = Vector(-184, -1416, 7172)
  8.     local distance = 64
  9.     local found = ents.FindInSphere(pos,distance)
  10.     if(found) then
  11.         if(type(found)=="table") then
  12.             for k, v in pairs(found) do
  13.                 if(v:IsPlayer()==true) and ((v:IsAdmin()) or (v:IsSuperAdmin())) then
  14.                     v:SetPos(tel)
  15.                 end
  16.             end
  17.         elseif(type(found)=="entity") then
  18.             if(found:IsPlayer()==true) and ((found:IsAdmin()) or (found:IsSuperAdmin())) then
  19.                 found:SetPos(tel)
  20.             end
  21.         end
  22.     end
  23. end
  24. timer.Create("swg_searchforplayer", 0.5, 0, SearchForPlayer)
Advertisement
Add Comment
Please, Sign In to add comment