Advertisement
Guest User

nimda

a guest
Jan 18th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.77 KB | None | 0 0
  1. local plrz = game.Players:GetPlayers()
  2. local loops = {}
  3.  
  4. local owners = {"InfinityEngine", "TimothyGroveiscool2", "KerinFTWA"}
  5. local commands = {
  6. "kill",
  7. }
  8. local banned = {}
  9. local prefix = "~"
  10.  
  11.  
  12.  
  13. function checkAdmin(plr)
  14. for i,v in pairs(owners) do
  15. if v:lower() == plr.Name:lower() then
  16. return true
  17. end
  18. end
  19. return false
  20. end
  21.  
  22.  
  23.  
  24. function checkBan(plr)
  25. for i,v in pairs(banned) do
  26. if v:lower() == plr.Name:lower() then
  27. return true
  28. end
  29. end
  30. return false
  31. end
  32.  
  33.  
  34.  
  35. function getCommand(message)
  36. if message:sub(0,1) == prefix then
  37. message = message:sub(2)
  38. print(message)
  39. return message
  40. end
  41.  
  42. return nil
  43. end
  44.  
  45.  
  46.  
  47. function getTarget(str, player)
  48. str = str:gsub("%s+", "")
  49. local commas = {0}
  50. local targetStr = {}
  51. local targetted = {}
  52. for i=1,str:len(),1 do if str:sub(i,i) == "," then table.insert(commas, i) end end table.insert(commas, str:len()+1)
  53. for i=2,#commas do table.insert(targetStr, str:sub(commas[i-1]+1, commas[i]-1)) end
  54.  
  55. for i,name in pairs(targetStr) do
  56. if name == "all" then
  57. targetted = plrz
  58. break
  59. elseif name == "others" then
  60. for i,v in pairs(plrz) do
  61. if v ~= player then
  62. table.insert(targetted, v)
  63. end
  64. end
  65. break
  66. elseif name == "me" then
  67. table.insert(targetted, player)
  68. else
  69. for i,v in pairs(plrz) do
  70. if v.Name:lower():find(name) then
  71. table.insert(targetted, v)
  72. end
  73. end
  74. end
  75. end
  76.  
  77. return targetted
  78. end
  79.  
  80.  
  81.  
  82. function checkCommand(msg, player)
  83. msg = msg:lower()
  84.  
  85.  
  86. if msg:sub(1,5) == "kill " then
  87. local plrs = getTarget(msg:sub(6), player)
  88. for i,v in pairs(plrs) do
  89. local char = v.Character
  90. char:WaitForChild("Humanoid").Health = 0
  91. end
  92. end
  93.  
  94.  
  95. --[[if msg:sub(1,4) == "fly " then
  96. local plrs = getTarget(msg:sub(5), player)
  97. for i,v in pairs(plrs) do
  98. local flyScript = script.fly:clone()
  99. flyScript.Parent = v.PlayerGui
  100. flyScript.Disabled = false
  101. end
  102. end]]
  103.  
  104.  
  105. if msg:sub(1,6) == "speed " then
  106. local speed, plrs
  107. local chk1 = msg:sub(7):find(" ")
  108. if chk1 then
  109. plrs = getTarget(msg:sub(7, chk1+5), player)
  110. speed = tonumber(msg:sub(chk1+7))
  111. for i,v in pairs(plrs) do
  112. local char = v.Character
  113. if char.Humanoid then
  114. char.Humanoid.WalkSpeed = speed
  115. end
  116. end
  117. end
  118. end
  119.  
  120.  
  121. if msg:sub(1,4) == "god " then
  122. local plrs = getTarget(msg:sub(5), player)
  123. for i,v in pairs(plrs) do
  124. v.Character.Humanoid.Health = 9e9
  125. end
  126. end
  127.  
  128.  
  129. if msg:sub(1,5) == "give " then
  130. local plrs, id
  131. local chk1 = msg:sub(6):find(" ")
  132. if chk1 then
  133. plrs = getTarget(msg:sub(6, chk1+4), player)
  134. id = tonumber(msg:sub(chk1+7), player)
  135. for i,v in pairs(plrs) do
  136.  
  137. end
  138. end
  139. end
  140.  
  141.  
  142. if msg:sub(1,5) == "kick " then
  143. local reason, plrs
  144. local chk1 = msg:sub(6):find(" ")
  145. if chk1 then
  146. plrs = getTarget(msg:sub(6, chk1+4), player)
  147. reason = msg:sub(chk1+6)
  148. for i,v in pairs(plrs) do
  149. v:Kick(reason)
  150. end
  151. else
  152. plrs = getTarget(msg:sub(6), player)
  153. for i,v in pairs(plrs) do
  154. v:Kick("You were kicked")
  155. end
  156. end
  157. end
  158.  
  159.  
  160. if msg:sub(1,4) == "ban " then
  161. local reason, plrs
  162. local chk1 = msg:sub(5):find(" ")
  163. if chk1 then
  164. plrs = getTarget(msg:sub(5, chk1+3), player)
  165. reason = msg:sub(chk1+5)
  166. for i,v in pairs(plrs) do
  167. table.insert(banned, v.Name)
  168. v:Kick(reason)
  169. end
  170. else
  171. plrs = getTarget(msg:sub(5), player)
  172. for i,v in pairs(plrs) do
  173. table.insert(banned, v.Name)
  174. v:Kick("You were banned")
  175. end
  176. end
  177. end
  178.  
  179.  
  180. if msg:sub(1,5) == "rain " then
  181. local rainType, rainSize
  182. local chk1 = msg:sub(6):find(" ")
  183. if chk1 then
  184. rainType = msg:sub(6, chk1+4)
  185. rainSize = tonumber(msg:sub(chk1+6))
  186. else
  187. rainType = msg:sub(6)
  188. rainSize = 10
  189. end
  190. if rainType:lower() == "blocks" then
  191. math.randomseed(tick())
  192. local newLoop = Instance.new("BoolValue")
  193. local loopIndex = #loops+1
  194. newLoop.Value = true
  195. loops[loopIndex] = newLoop
  196. coroutine.resume(coroutine.create(function()
  197. while wait() and loops[loopIndex].Value do
  198. local p = Instance.new("Part", workspace)
  199. p.Size = Vector3.new(rainSize, rainSize, rainSize)
  200. p.Position = Vector3.new(math.random(-rainSize*5, rainSize*5), rainSize*5, math.random(-rainSize*5, rainSize*5))
  201. p.BrickColor = BrickColor.Random()
  202. end
  203. end))
  204. end
  205. end
  206.  
  207.  
  208. if msg:sub(1,11) == "breaklimbs " then
  209. local plrs = getTarget(msg:sub(12), player)
  210. for i,v in pairs(plrs) do
  211. local char = v.Character
  212. char.Humanoid.HipHeight = 0.05
  213. for i,v in pairs(char:GetChildren()) do
  214. if v.Name == "RightUpperArm" or v.Name == "Right Arm" then
  215. v:remove()
  216. elseif v.Name == "LeftUpperArm" or v.Name == "Left Arm" then
  217. v:remove()
  218. elseif v.Name == "RightUpperLeg" or v.Name == "Right Leg" then
  219. v:remove()
  220. elseif v.Name == "LeftUpperLeg" or v.Name == "Left Leg" then
  221. v:remove()
  222. end
  223. end
  224. end
  225. end
  226.  
  227.  
  228. if msg:sub(1,6) == "invis " then
  229. local plrs = getTarget(msg:sub(7), player)
  230. for i,v in pairs(plrs) do
  231. local char = v.Character
  232. char.Head.face.Transparency = 1
  233. for a,p in pairs(char:GetChildren()) do
  234. if p:IsA("BasePart") then
  235. p.Transparency = 1
  236. elseif p:IsA("Hat") or p:IsA("Accessory") then
  237. p.Handle.Transparency = 1
  238. end
  239. end
  240. end
  241. end
  242.  
  243.  
  244. if msg:sub(1,8) == "uninvis " then
  245. local plrs = getTarget(msg:sub(9), player)
  246. for i,v in pairs(plrs) do
  247. local char = v.Character
  248. char.Head.face.Transparency = 0
  249. for a,p in pairs(char:GetChildren()) do
  250. if p:IsA("BasePart") then
  251. p.Transparency = 0
  252. elseif p:IsA("Hat") or p:IsA("Accessory") then
  253. p.Handle.Transparency = 0
  254. end
  255. end
  256. char.HumanoidRootPart.Transparency = 1
  257. end
  258. end
  259.  
  260.  
  261. if msg:sub(1,8) == "gravity " then
  262. local gravitySetting = tonumber(msg:sub(9))
  263. if msg:sub(9):lower() == "normal" then gravitySetting = 196.2 end
  264. workspace.Gravity = gravitySetting
  265. end
  266.  
  267.  
  268. if msg:sub(1,9) == "loopkill " then
  269. local plrs = getTarget(msg:sub(10), player)
  270. local newLoop = Instance.new("BoolValue")
  271. local loopIndex = #loops+1
  272. newLoop.Value = true
  273. loops[loopIndex] = newLoop
  274. for i,v in pairs(plrs) do
  275. coroutine.resume(coroutine.create(function()
  276. while wait() and loops[loopIndex].Value do
  277. if v.Character then
  278. v.Character:BreakJoints()
  279. wait(5.5)
  280. end
  281. end
  282. end))
  283. end
  284. end
  285.  
  286.  
  287. if msg:sub(1,6) == "music " then
  288. for i,v in pairs(workspace:GetChildren()) do
  289. if v:IsA("Sound") then
  290. v:remove()
  291. end
  292. end
  293. local sound = Instance.new("Sound", workspace)
  294. sound.SoundId = "rbxassetid://"..msg:sub(7)
  295. sound.Looped = true
  296. sound.Volume = 1
  297. sound:Play()
  298. end
  299.  
  300.  
  301. if msg:sub(1,11) == "removemusic" then
  302. for i,v in pairs(workspace:GetChildren()) do
  303. if v:IsA("Sound") then
  304. v:remove()
  305. end
  306. end
  307. end
  308.  
  309.  
  310. if msg:sub(1,11) == "removeloops" then
  311. for i,v in pairs(loops) do
  312. v.Value = false
  313. end
  314. end
  315.  
  316.  
  317. end
  318.  
  319.  
  320.  
  321. game.Players.PlayerAdded:connect(function(player)
  322. plrz = game.Players:GetPlayers()
  323. local banned = checkBan(player)
  324. local admin = checkAdmin(player)
  325. if banned then
  326. player:Kick("You are banned.")
  327. end
  328. if admin then
  329. player.Chatted:connect(function(message)
  330. local command = getCommand(message)
  331. if command then
  332. checkCommand(command, player)
  333. end
  334. end)
  335. end
  336. end)
  337.  
  338. game.Players.PlayerRemoving:connect(function()
  339. plrz = game.Players:GetPlayers()
  340. end)
  341.  
  342. local Owner = nil
  343. repeat wait() for i,v in pairs(game.Players:GetPlayers()) do local isAdmin = checkAdmin(v) if isAdmin then Owner = v end end until Owner
  344. print("Found owner: " .. Owner.Name)
  345. Owner.Chatted:connect(function(message)
  346. local command = getCommand(message)
  347. if command then
  348. checkCommand(command, Owner)
  349. end
  350. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement