Guest User

Untitled

a guest
Sep 14th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. local players = {}
  2. local x, y, z = 0, 0, 0
  3. local warping = false
  4. local warpLimit = 0
  5. local warps = 0
  6. function setWarp(plr, _, lim)
  7.         players = {}
  8.         local px, py, pz = getElementPosition(plr)
  9.         warpLimit = tonumber(lim)
  10.         x = px
  11.         y = py
  12.         z = pz
  13.         warping = true
  14.         warps = 0
  15.         outputChatBox("An event has been started use /warp to join , Event hosted by : " .. getPlayerName(plr), root, 0, 255, 0)
  16. end
  17. addCommandHandler("setwarp", setWarp)
  18.  
  19. function warpToEvent(plr)
  20.         if (warping and not players[plr] and warps < warpLimit) then
  21.                 setElementPosition(plr, x, y, z)
  22.                 setElementFrozen(plr, true)
  23.                 players[plr] = true
  24.                 warps = warps + 1
  25.         end
  26. end
  27. addCommandHandler("warp", warpToEvent)
  28.  
  29. function unFreezeAll(plr)
  30.         for a,b in pairs(players) do
  31.                 setElementFrozen(plr, false)
  32.         end
  33. end
  34. addCommandHandler("unfree", unFreezeAll)
Add Comment
Please, Sign In to add comment