Advertisement
Guest User

Untitled

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