Advertisement
Agent_Silence

SAFEGUARD

Apr 17th, 2015
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. local range = 20
  2. local whitelist = {}
  3.  
  4. if not commands then
  5.     error("Not running on command computer")
  6. end
  7.  
  8. local success, obj = commands.exec("scoreboard objectives list")
  9. if success == true then
  10.     local found = false
  11.     for i,v in pairs(obj) do
  12.         if v == "Whitelisted33" then
  13.             found = true
  14.         end
  15.     end
  16.     if found == false then
  17.         commands.execAsync("scoreboard objectives add Whitelisted33 dummy")
  18.     end
  19. else
  20.     commands.execAsync("scoreboard objectives add Whitelisted33 dummy")
  21. end
  22.  
  23. for i,v in pairs(whitelist) do
  24.     commands.execAsync("scoreboard players set "..v.." Whitelisted33 1")
  25. end
  26.  
  27. while true do
  28.     commands.execAsync("gamemode adventure @a[m=1,r="..range..",score_Whitelisted33=0]")
  29.     commands.execAsync("gamemode adventure @a[m=0,r="..range..",score_Whitelisted33=0]")
  30.     commands.execAsync("gamemode survival @a[rm="..range+(1)..",r="..range+(11)..",m=2,score_Whitelisted33=0]")
  31.     sleep(0.5)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement