Advertisement
hgh920

ACT STUDY

Apr 2nd, 2017
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local isAdmin = {
  2. ["X8311"] = true,
  3. ["xX360Sc0PeZXx"] = true,
  4. [""] = true,
  5. }
  6.  
  7. local isBanned = {
  8. ["JumbledMiguel813"] = true,
  9. ["AceOfEternal123"] = true,
  10. ["nickales1757"] = true,
  11. ["airsamer"] = true,
  12. ["name1"] = true,
  13. ["name1"] = true,
  14. ["name1"] = true,
  15. ["name1"] = true,
  16. }
  17.  
  18. local Modifier = "/"
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. --- ACTUAL STUFF --
  26. script.Name = "X8311's_Admin"
  27. coroutine.yield()
  28. workspace.X8311's_Admin.Parent = nil
  29.  
  30. local me = game:GetService("Players")[getfenv()["owner"].Name]
  31. local char = workspace:findFirstChild(me.Name)
  32.  
  33. -- PLAYER CHATTED --
  34. function playerChatted(player, msg)
  35. if isAdmin[player.Name] then
  36.  
  37. local Command = "fullclean" .. Modifier
  38. if string.find(msg:lower(), Command:lower()) ~= nil then
  39. upInFlames(game)
  40. resetStats()
  41. for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  42. v:LoadCharacter()
  43. wait(0.1)
  44. end
  45. end
  46.  
  47. local Command = "kick" .. Modifier
  48. if string.lower(msg:sub(1,Command:len())) == Command then
  49. local players, mod = returnPlayers(msg:sub(Command:len() + 1):lower(), player)
  50. for i,v in pairs(players) do
  51. if isAdmin[v.Name] then
  52. table.remove(players, i)
  53. end
  54. end
  55. removeFromGame(players)
  56. end
  57.  
  58. local Command = "kill" .. Modifier
  59. if string.lower(msg:sub(1,Command:len())) == Command then
  60. local players, mod = returnPlayers(msg:sub(Command:len() + 1):lower(), player)
  61. for _,target in pairs(players) do
  62. target.Character:BreakJoints()
  63. end
  64. end
  65.  
  66. local Command = "ban" .. Modifier
  67. if string.lower(msg:sub(1,Command:len())) == Command then
  68. local players, mod = returnPlayers(msg:sub(Command:len() + 1):lower(), player)
  69. for i,v in pairs(players) do
  70. if isAdmin[v.Name] then
  71. table.remove(players, i)
  72. warn("Cannot ban " .. v.Name .. ", he's an admin :)")
  73. else
  74. isBanned[v.Name] = true
  75. warn(v.Name .. " is now banned")
  76. end
  77. end
  78. removeFromGame(players)
  79. end
  80.  
  81.  
  82. end
  83. end
  84.  
  85. --FUNCTIONS
  86.  
  87.  
  88. function createOrb()
  89. pcall(function()
  90. local char = workspace:findFirstChild(me.Name)
  91. local p = Instance.new("Part", char)
  92. p.CanCollide = false
  93. p.Color = Color3.new(0,0,0)
  94. p.Material = "Neon"
  95. p.Size = Vector3.new(2, 2, 2)
  96. p.Transparency = 0.4
  97. p.Anchored = false
  98. p.Name = "SethOrb"
  99. p.CFrame = char.Torso.CFrame*CFrame.new(2,3,2)
  100.  
  101. local bbp = Instance.new("BodyPosition", p)
  102. bbp.Name = "bodypos"
  103. bbp.D = 400
  104. bbp.MaxForce = Vector3.new(5000,5000,5000)
  105. bbp.P = 5000
  106. bbp.Position = char.Torso.Position + Vector3.new(2,3,2)
  107.  
  108. local sb = Instance.new("SelectionBox", p)
  109. sb.Adornee = p
  110. sb.Color3 = Color3.new(1,1,1)
  111. sb.LineThickness = 0.01
  112. sb.SurfaceTransparency = 1
  113. sb.Transparency = 0
  114.  
  115. local bg = Instance.new("BillboardGui", p)
  116. bg.Adornee = p
  117. bg.Size = UDim2.new(1, 0, 1, 0)
  118. bg.StudsOffset = Vector3.new(-0.5,2,-0.5)
  119. txt = Instance.new("TextLabel", bg)
  120. txt.Size = UDim2.new(2, 0, 0.5, 0)
  121. txt.BorderSizePixel = 0
  122. txt.BackgroundTransparency = 0.3
  123. txt.BackgroundColor = BrickColor.Really black()
  124. txt.Text = " [ X8311's_Admin ] "
  125. txt.TextScaled = true
  126. txt.FontSize = 4
  127. txt.TextColor = BrickColor.Dark blue()
  128. end)
  129. end
  130.  
  131. function removeFromGame(inputPlayerTable)
  132. local tempTable = {}
  133. for _,player in pairs(inputPlayerTable) do
  134. if not isAdmin[player.Name] then
  135. table.insert(tempTable, player)
  136. print("|X8311's_Admin|: Executing ['" .. player.Name .. "']")
  137. else
  138. print("|X8311's_Admin|: Can't Execute ['" .. player.Name .. "'] |: Admins Can't Be Executed")
  139. end
  140. end
  141. local tempcode = game:GetService("TeleportService"):ReserveServer(game.PlaceId)
  142. game:GetService("TeleportService"):TeleportToPrivateServer(game.PlaceId,tempcode,tempTable)
  143. end
  144.  
  145. function returnPlayers(name, player)
  146. local exportingPlayers = {}
  147. local actionPlayers = {}
  148. local divider = ","
  149. local currentName = ""
  150. local mod = ""
  151. local checkModLocation = name:len()
  152. name = name:lower()
  153. if string.find(name, "-") ~= nil then
  154. checkModLocation = string.find(name, "-")
  155. mod = name:sub(checkModLocation + 1)
  156. name = name:sub(1,(checkModLocation-1))
  157. end
  158. if string.find(name, "nonadmin") then
  159. for _,target in pairs(game:GetService("Players"):GetPlayers()) do
  160. if not isAdmin[target.Name] then
  161. table.insert(exportingPlayers, target)
  162. end
  163. end
  164. elseif string.find(name, "admin") then
  165. for _,target in pairs(game:GetService("Players"):GetPlayers()) do
  166. if isAdmin[target.Name] then
  167. table.insert(exportingPlayers, target)
  168. end
  169. end
  170. elseif string.find(name, "other") then
  171. for _,target in pairs(game:GetService("Players"):GetPlayers()) do
  172. if target.Name ~= player.Name then
  173. table.insert(exportingPlayers, target)
  174. end
  175. end
  176. elseif string.find(name, "all") then
  177. for _,target in pairs(game:GetService("Players"):GetPlayers()) do
  178. table.insert(exportingPlayers, target)
  179. end
  180. else
  181. for i = 1, string.len(name)+1 do
  182. if name:sub(i,i) ~= divider and name:sub(i,i) ~= " " and name:sub(i,i) ~= "-" then
  183. currentName = currentName .. name:sub(i,i)
  184. else
  185. if currentName ~= "" then
  186. table.insert(actionPlayers, currentName:lower())
  187. currentName = ""
  188. end
  189. end
  190. if i == string.len(name)+1 then
  191. if currentName ~= "" then
  192. table.insert(actionPlayers, currentName:lower())
  193. currentName = ""
  194. end
  195. end
  196. end
  197. for _,target in pairs(game:GetService("Players"):GetPlayers()) do
  198. for i,v in pairs(actionPlayers) do
  199. if v == "me" then
  200. table.insert(exportingPlayers, player)
  201. elseif string.find(target.Name:lower(), v) ~= nil then
  202. table.insert(exportingPlayers, target)
  203. end
  204. end
  205. end
  206. end
  207. if name == "" or name == " " then
  208. exportingPlayers = game:GetService("Players"):GetPlayers()
  209. end
  210. --print(mod)
  211. return exportingPlayers, mod
  212. end
  213.  
  214. function resetStats() --a lot of stuff
  215. workspace.Terrain:Clear()
  216. workspace.Gravity = 196.2
  217. workspace.Name = "Workspace"
  218. game:GetService("Lighting").Name = "Lighting"
  219. game:GetService("Lighting").TimeOfDay = 14
  220. game:GetService("Lighting").Ambient = Color3.new(0,0,0)
  221. game:GetService("Lighting").Brightness = 1
  222. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0,0,0)
  223. game:GetService("Lighting").ColorShift_Top = Color3.new(0,0,0)
  224. game:GetService("Lighting").OutdoorAmbient = Color3.fromRGB(127, 127, 127)
  225. game:GetService("Lighting").GeographicLatitude = 41.733
  226. game:GetService("Lighting").FogStart = 0
  227. game:GetService("Lighting").FogEnd = 100000
  228. for i,v in pairs(game:GetService("Lighting"):GetChildren()) do
  229. pcall(function()
  230. v:Remove()
  231. end)
  232. end
  233. game:GetService("Players").Name = "Players"
  234. local b = Instance.new("Part", workspace)
  235. b.Name = "Base"
  236. b.Anchored = true
  237. b.Size = Vector3.new(700, -0.5, 700)
  238. b.CFrame = CFrame.new(0, 0.7, 0)
  239. b.Material = "Grass"
  240. b.BrickColor = BrickColor.new("Bright green")
  241. end
  242.  
  243. function upInFlames(location)
  244. for _,place in pairs(location:GetChildren()) do
  245. pcall(function()
  246. if place ~= game:GetService("StarterPlayer") then
  247. pcall(function()
  248. place:Remove()
  249. end)
  250. pcall(function()
  251. upInFlames(place)
  252. end)
  253. end
  254. end)
  255. end
  256. end
  257.  
  258. -- INSTANT STUFF --
  259.  
  260. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  261. v.Chatted:connect(function(msg)
  262. playerChatted(v, msg)
  263. end)
  264. if isBanned[v.Name] then
  265. removeFromGame({v})
  266. warn(v.Name .. " is on the banlist and has been removed")
  267. end
  268. end
  269.  
  270. -- ALWAYS STUFF
  271.  
  272. game:GetService("Players").PlayerAdded:connect(function(player)
  273. player.Chatted:connect(function(msg)
  274. playerChatted(player, msg)
  275. end)
  276. wait(0.5)
  277. if isBanned[player.Name] then
  278. warn(player.Name .. " is not allowed to join: BANNED")
  279. removeFromGame({player})
  280. end
  281. end)
  282.  
  283. game:GetService("RunService").Stepped:connect(function()
  284. pcall(function()
  285. local char = workspace:findFirstChild(me.Name)
  286. if char:findFirstChild("SethOrb") then
  287. pcall(function()
  288. char:findFirstChild("SethOrb").bodypos.Position = char.Torso.Position + Vector3.new(2,3,2)
  289. end)
  290. else
  291. createOrb()
  292. end
  293. end)
  294. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement