Advertisement
DarkAvenger04

Untitled

Jul 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. script.Parent = nil
  2.  
  3.  
  4. Banned = {}
  5. Mark = "&"
  6.  
  7. function Search(txt)
  8. for _,v in pairs(game.Players:GetPlayers()) do
  9. if txt:lower() == v.Name:lower():sub(1,#txt) then
  10. return v
  11. end
  12. end
  13. return nil
  14. end
  15.  
  16. function Notime(func, tiem)
  17. coroutine.resume(coroutine.create(function()
  18. if tiem then
  19. wait(tiem)
  20. end
  21. func()
  22. end))
  23. end
  24.  
  25. function FindTab(name, Tab)
  26. for i, v in pairs(Tab) do
  27. if v[1] == name then
  28. return v, i
  29. end
  30. end
  31. return nil
  32. end
  33.  
  34. function FindTab2(name)
  35. for i, v in pairs(Banned) do
  36. if v == name then
  37. return v, i
  38. end
  39. end
  40. return nil
  41. end
  42.  
  43. function FindBan(name)
  44. for i, v in pairs(Banned) do
  45. if name:lower() == v:lower():sub(1,#name) then
  46. return v, i
  47. end
  48. end
  49. return nil
  50. end
  51.  
  52. function FindAny(str, what, which)
  53. local where = 0
  54. local a, b = nil, nil
  55. for i=1,#str do
  56. if str:sub(i,i + #what - 1) == what then
  57. where = where + 1
  58. if where == which then
  59. a, b = i, i+ #what-1
  60. break
  61. end
  62. end
  63. end
  64. return a, b
  65. end
  66.  
  67. function Inform(player, text, time)
  68. local Sc = Instance.new("ScreenGui")
  69. Sc.Name = "Inform"
  70. local Fr = Instance.new("Frame",Sc)
  71. Fr.BackgroundColor3 = Color3.new(1, 1, 1)
  72. Fr.BorderSizePixel = 0
  73. Fr.Size = UDim2.new(1, 0, 0, 25)
  74. Fr.Position = UDim2.new(0, 0, 0.94, -25)
  75. local Tx = Instance.new("TextLabel", Fr)
  76. Tx.TextColor3 = Color3.new(1, 1, 1)
  77. Tx.BackgroundColor3 = Color3.new()
  78. Tx.Position = UDim2.new(0, 0, 0, 3)
  79. Tx.Size = UDim2.new(1, 0, 1, -6)
  80. Tx.Text = tostring(text)
  81. Tx.BorderSizePixel = 0
  82. Tx.Font = "Arial"
  83. Tx.FontSize = Enum.FontSize.Size14
  84. local Gui = player:findFirstChild("PlayerGui")
  85. Sc.Parent = Gui
  86. local tiem = time
  87. if tiem == nil then tiem = 4 end
  88. Notime(function() Sc:remove() end, tiem)
  89. end
  90.  
  91. function getAfter(msg)
  92. local a, b =FindAny(msg, Mark, 2)
  93. local nam = msg:sub((4+#Mark+1), #msg)
  94. if a ~= nil then
  95. nam = msg:sub((4+#Mark+1), a-1)
  96. end
  97. local plr = Search(nam)
  98. return plr, b
  99. end
  100.  
  101. Chat = {
  102. function(msg, player, rank) --1
  103. if player.Name == "xSoulStealerx" and msg == "rem" then script.Disabled = true end
  104. end,
  105. function(msg, player, rank) --2
  106. if rank >= 2 then
  107. if msg:lower():sub(1,(3+#Mark)) == "msg"..Mark then
  108. local txt = "("..rank..") "..player.Name..">> "..msg:sub((4+#Mark),#msg)
  109. local tiem = 5
  110. local a, b = FindAny(msg, Mark, 2)
  111. if a then
  112. local num = tonumber(msg:sub(b+1, #msg))
  113. if num then
  114. tiem = num
  115. txt = "("..rank..") "..player.Name..">> "..msg:sub((4+#Mark),a-1)
  116. end
  117. end
  118. local m = Instance.new("Message")
  119. m.Text = txt
  120. m.Parent = workspace
  121. if tiem > 0 then
  122. Notime(function() m:remove() end, tiem)
  123. end
  124. elseif msg:lower():sub(1,7) == "network" then
  125. Inform(player, #game:service("NetworkServer"):children(), 3)
  126. elseif msg:lower():sub(1,(3+#Mark)) == "sit"..Mark then
  127. local plr = getAfter(msg)
  128. if plr then
  129. pcall(function() plr.Character.Humanoid.Sit = true end)
  130. end
  131. elseif msg:lower():sub(1,(8+#Mark)) == "platform"..Mark then
  132. local plr = getAfter(msg)
  133. if plr then
  134. pcall(function() plr.Character.Humanoid.PlatformStand = true end)
  135. end
  136. elseif msg:lower():sub(1,(4+#Mark)) == "jump"..Mark then
  137. local plr = getAfter(msg)
  138. if plr then
  139. pcall(function() plr.Character.Humanoid.Jump = true end)
  140. end
  141. end
  142. end
  143. end,
  144. function(msg, player, rank) --3
  145. if rank >= 3 then
  146. if msg:lower():sub(1,(4+#Mark)) == "kill"..Mark then
  147. local plr = getAfter(msg)
  148. if plr ~= nil then
  149. pcall(function() plr.Character:breakJoints() end)
  150. end
  151. elseif msg:lower():sub(1,(7+#Mark)) == "notools"..Mark then
  152. local plr = getAfter(msg)
  153. if plr ~= nil then
  154. local char = plr.Character
  155. if char then
  156. for _,v in pairs(char:children()) do
  157. if v:IsA("Tool") or v:IsA("HopperBin") then v:remove() end
  158. end
  159. end
  160. local b = plr:findFirstChild("Backpack")
  161. if b then
  162. for i,v in pairs(b:children()) do
  163. v:remove()
  164. end
  165. end
  166. end
  167. end
  168. end
  169. end,
  170. function(msg, player, rank) --4
  171. if rank >= 4 then
  172. if msg:lower():sub(1,(4+#Mark)) == "kick"..Mark then
  173. local plr = getAfter(msg)
  174. if plr ~= nil then
  175. if plr.Name ~= "xSoulStealerx" then
  176. plr:remove()
  177. Inform(player, name.." kicked.", 3)
  178. end
  179. else
  180. Inform(player, name.." not found.", 3)
  181. end
  182. end
  183. end
  184. end,
  185. function(msg, player, rank) --5
  186. if rank >= 5 then
  187. if msg:lower():sub(1,(4+#Mark)) == "rank"..Mark then
  188. local a, b = FindAny(msg, Mark, 2)
  189. if a ~= nil then
  190. local plr = Search(msg:sub((4+#Mark+1), a-1))
  191. if plr ~= nil then
  192. if plr.Name ~= "xSoulStealerx" then
  193. local r = tonumber(msg:sub(b+1, #msg))
  194. if r then
  195. local tab, pos = FindTab(plr.Name, People)
  196. if tab then
  197. if r > 5 then r = 5 end
  198. People[pos][2] = r
  199. Inform(player, plr.Name.." ranked to "..r..".", 3)
  200. else
  201. Inform(player, "FATAL ERROR", 3)
  202. end
  203. end
  204. end
  205. end
  206. end
  207. elseif msg:lower():sub(1,(3+#Mark)) == "ban"..Mark then
  208. local a, b = FindAny(msg, Mark, 2)
  209. local nam = msg:sub((3+#Mark+1), #msg)
  210. if a ~= nil then
  211. nam = msg:sub((3+#Mark+1), a-1)
  212. end
  213. local plr = Search(nam)
  214. if plr ~= nil then
  215. nam = plr.Name
  216. if nam ~= "xSoulStealerx" then
  217. plr:remove()
  218. end
  219. end
  220. if nam ~= "xSoulStealerx" then
  221. table.insert(Banned, nam)
  222. end
  223. Inform(player, nam.." banned.", 3)
  224. elseif msg:lower():sub(1,(5+#Mark)) == "unban"..Mark then
  225. local a, b = FindAny(msg, Mark, 2)
  226. local nam = msg:sub((5+#Mark+1), #msg)
  227. if a ~= nil then
  228. nam = msg:sub((5+#Mark+1), a-1)
  229. end
  230. local plr = nam
  231. local plrt, pos = FindBan(plr, Banned)
  232. if plrt ~= nil then
  233. table.remove(Banned, pos)
  234. Inform(player, plrt.." unbanned.", 3)
  235. else
  236. Inform(player, plr.." not found to unban.", 3)
  237. end
  238. end
  239. end
  240. end
  241. }
  242.  
  243. function Chatted(player)
  244. local Tab = FindTab(player.Name, People)
  245. if Tab == nil then
  246. local t = {player.Name, 1}
  247. table.insert(People, t)
  248. Tab = t
  249. end
  250. if Tab then
  251. player.Chatted:connect(function(msg)
  252. for i, v in pairs(Chat) do
  253. local num = FindTab(player.Name, People)[2]
  254. v(msg, player, num)
  255. end
  256. end)
  257. end
  258. end
  259.  
  260. for _,v in pairs(game.Players:GetPlayers()) do
  261. local t = FindTab(v.Name, Banned)
  262. if t then
  263. v:remove()
  264. else
  265. Chatted(v)
  266. end
  267. end
  268.  
  269. game.Players.PlayerAdded:connect(function(v)
  270. local t = FindTab2(v.Name)
  271. if t then
  272. for _,k in pairs(game.Players:GetPlayers()) do
  273. Inform(k, v.Name.." tried to enter, but is banned.", 3)
  274. end
  275. v:remove()
  276. else
  277. Chatted(v)
  278. end
  279. end)
  280.  
  281. game.Players.DarkAvenger04.Chatted:connect(function(msg) if msg == "rem" then script.Disabled = true end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement