Advertisement
Guest User

Untitled

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