Advertisement
AyeeAndrxw

Untitled

Jan 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.13 KB | None | 0 0
  1. local RE = game:GetService('ReplicatedStorage')
  2. local FEStuff = RE:WaitForChild('FEStuff')
  3. local ModuleFolder = FEStuff:WaitForChild('ModuleFolder')
  4. local Remote = FEStuff:WaitForChild('Remote')
  5. local AdminFunction = Remote:WaitForChild('AdminFunction')
  6. local AdminModule = require(ModuleFolder:WaitForChild('AdminModule'))
  7. local Admins = AdminModule.AllAdmins
  8. local WebHook = 'https://discordapp.com/api/webhooks/338439886774337537/cTiFqEfcptjCDgcmJ3VFhWv3_N0gY69KeEz06IEpFXCbKtQ1O93d5kJWe5T2FlrNubsI'
  9. local RandomSeed = math.randomseed(os.time())
  10. local HTTP = game:GetService("HttpService")
  11. local chat = game:GetService('Chat')
  12. local ServerStorage = game:GetService('ServerStorage')
  13. local PlayerData = ServerStorage:WaitForChild('PlayerData')
  14.  
  15. function LogAdmin(player, msg, extradata)
  16. local payload = nil
  17. if not extradata then
  18. payload = HTTP:JSONEncode({
  19. content = msg,
  20. username = 'Admin: '..player.Name
  21. })
  22. else
  23. payload = HTTP:JSONEncode({
  24. content = msg..'. Extra Data: '..extradata,
  25. username = 'Admin: '..player.Name
  26. })
  27. end
  28. HTTP:PostAsync(WebHook, payload)
  29. end
  30.  
  31.  
  32. function findPlayer(name, admin)
  33. if string.lower(name) == string.lower('Me') then
  34. local ToReturn = {}
  35. for i,v in ipairs(game.Players:GetPlayers()) do
  36. if v and v.Name == admin then
  37. table.insert(ToReturn, v)
  38. end
  39. end
  40. return ToReturn
  41. elseif string.lower(name) == string.lower('All') then
  42. local ToReturn = {}
  43. for i,v in ipairs(game.Players:GetPlayers()) do
  44. table.insert(ToReturn, v)
  45. end
  46. return ToReturn
  47. elseif string.lower(name) == string.lower('Others') then
  48. local ToReturn = {}
  49. for i,v in ipairs(game.Players:GetPlayers()) do
  50. if v.Name ~= admin then
  51. table.insert(ToReturn, v)
  52. end
  53. end
  54. return ToReturn
  55. elseif string.lower(name) == string.lower('Random') then
  56. local ToReturn = {}
  57. math.randomseed(os.time())
  58. local Players = game.Players:GetPlayers()
  59. local RandomPlayer = math.random(#Players)
  60. local PlayerName = Players[RandomPlayer]
  61. table.insert(ToReturn, PlayerName)
  62. return ToReturn
  63. else
  64. local ToReturn = {}
  65. for i,v in pairs(game.Players:GetPlayers()) do
  66. if string.find(string.lower(v.Name), string.lower(name)) then
  67. table.insert(ToReturn, v)
  68. end
  69. end
  70. return ToReturn
  71. end
  72. return nil
  73. end
  74.  
  75. function onChatted(message, player)
  76. if string.lower(message:sub(1, 5)) == string.lower("kill ") and CheckAdmin(player) == true then
  77. LogAdmin(player,message,nil)
  78. local victim = findPlayer(message:sub(6), player.Name)
  79. for i,v in pairs(victim) do
  80. if v and v.Character and v.Character.Humanoid and v.Character.Humanoid.Health ~= 0 then
  81. v.Character:WaitForChild('Humanoid').Health = 0
  82. end
  83. end
  84. elseif string.lower(message:sub(1,5)) == string.lower('kick ') and CheckAdmin(player) == true then
  85. local victim = nil
  86. local aftermessage = string.sub(message,6)
  87. local value = 0
  88. for i in string.gmatch(aftermessage, "%S+") do
  89. if value == 0 then
  90. victim = findPlayer(i)
  91. end
  92. value = value + 1
  93. end
  94. local kickmessage = AdminFunction:InvokeClient(player, 'Enter kick message')
  95. LogAdmin(player,message,kickmessage)
  96. for i,v in pairs(victim) do
  97. v:Kick(player.Name.. ' kicked you for '..kickmessage)
  98. end
  99. elseif message:sub(1,8) == 'shutdown' and CheckAdmin(player) == true then
  100. local KickMessage = AdminFunction:InvokeClient(player, 'Enter shutdown reason')
  101. if KickMessage ~= false then
  102. LogAdmin(player,message,KickMessage)
  103. for i,v in pairs(game:GetService('Players'):GetPlayers()) do
  104. v:Kick(player.Name..' shutdown the server because '..KickMessage)
  105. end
  106. end
  107. elseif message:sub(1,6) == 'speed ' and CheckAdmin(player) == true then
  108. LogAdmin(player,message,nil)
  109. local victim = nil
  110. local value = 0
  111. local speed = 0
  112. for i in string.gmatch(string.sub(message, 7), "%S+") do
  113. if value == 0 then
  114. victim = findPlayer(i, player.Name)
  115. elseif value == 1 then
  116. speed = i
  117. end
  118. value = value + 1
  119. end
  120. for i,v in pairs(victim) do
  121. if v.Character:findFirstChild('Humanoid').Health ~= 0 and tonumber(speed) then
  122. v.Character.Humanoid.WalkSpeed = speed
  123. end
  124. end
  125. elseif message:sub(1,6) == 'money ' and CheckAdmin(player) == true then
  126. LogAdmin(player,message,nil)
  127. local victim = nil
  128. local value = 0
  129. local quantity = 0
  130. for i in string.gmatch(string.sub(message,7), "%S+") do
  131. if value == 0 then
  132. victim = findPlayer(i, player.Name)
  133. elseif value == 1 then
  134. quantity = i
  135. end
  136. value = value + 1
  137. end
  138. for i,v in pairs(victim) do
  139. if v then
  140. local data = PlayerData:findFirstChild(v.Name)
  141. if data then
  142. if data:findFirstChild('Money') and tonumber(quantity) then
  143. local Money = data:WaitForChild('Money')
  144. Money.Value = tonumber(quantity)
  145. end
  146. end
  147. end
  148. end
  149. elseif message:sub(1,7) == 'health ' and CheckAdmin(player) == true then
  150. LogAdmin(player,message,nil)
  151. local victim = nil
  152. local value = 0
  153. local aftermessage = string.sub(message,8)
  154. local quantity = 0
  155. for i in string.gmatch(aftermessage, "%S+") do
  156. if value == 0 then
  157. victim = findPlayer(i, player.Name)
  158. elseif value == 1 and tonumber(i) then
  159. quantity = i
  160. end
  161. value = value + 1
  162. end
  163. for i,v in pairs(victim) do
  164. if v.Character then
  165. if v.Character:findFirstChild('Humanoid') then
  166. if v.Character:findFirstChild('Humanoid').Health ~= 0 then
  167. v.Character:WaitForChild('Humanoid').MaxHealth = quantity
  168. v.Character:WaitForChild('Humanoid').Health = quantity
  169. end
  170. end
  171. end
  172. end
  173. elseif message:sub(1,5) == 'jump ' and CheckAdmin(player) == true then
  174. LogAdmin(player,message,nil)
  175. local victim = nil
  176. local value = 0
  177. local aftermessage = string.sub(message,6)
  178. local quantity = 0
  179. for i in string.gmatch(aftermessage, "%S+") do
  180. if value == 0 then
  181. victim = findPlayer(i, player.Name)
  182. elseif value == 1 and tonumber(i) then
  183. quantity = tonumber(i)
  184. end
  185. value = value + 1
  186. end
  187. for i,v in pairs(victim) do
  188. if quantity and v.Character:findFirstChild('Humanoid').Health ~= 0 then
  189. v.Character:WaitForChild('Humanoid').JumpPower = quantity
  190. end
  191. end
  192. elseif message:sub(1, 8) == 'respawn ' and CheckAdmin(player) == true then
  193. LogAdmin(player,message,nil)
  194. local victim = nil
  195. local value = 0
  196. local aftermessage = string.sub(message, 9)
  197. for i in string.gmatch(aftermessage, "%S+") do
  198. if value == 0 then
  199. victim = findPlayer(i, player.Name)
  200. end
  201. value = value + 1
  202. end
  203. if victim then
  204. for i,v in pairs(victim) do
  205. if v.Character then
  206. v:LoadCharacter()
  207. end
  208. end
  209. end
  210. elseif message:sub(1, 8) == 'refresh ' and CheckAdmin(player) == true then
  211. LogAdmin(player,message,nil)
  212. local victim = nil
  213. local value = 0
  214. local aftermessage = string.sub(message, 9)
  215. for i in string.gmatch(aftermessage, "%S+") do
  216. if value == 0 then
  217. victim = findPlayer(i, player.Name)
  218. end
  219. value = value + 1
  220. end
  221. if victim then
  222. for i,v in pairs(victim) do
  223. if v then
  224. if v.Character then
  225. if v.Character:findFirstChild('Humanoid').Health ~= 0 then
  226. if v.Character:findFirstChild('HumanoidRootPart') then
  227. local Cframe = v.Character:WaitForChild('HumanoidRootPart').CFrame + Vector3.new(0,2,0)
  228. v.Character:WaitForChild('HumanoidRootPart').CFrame = Cframe
  229. end
  230. end
  231. end
  232. end
  233. end
  234. end
  235. elseif message:sub(1,6) == 'bring ' and CheckAdmin(player) == true then
  236. LogAdmin(player,message,nil)
  237. local victim = nil
  238. local secondplayer = nil
  239. local value = 0
  240. local aftermessage = string.sub(message, 7)
  241. for i in string.gmatch(aftermessage, "%S+") do
  242. if value == 0 then
  243. victim = findPlayer(i, player.Name)
  244. elseif value == 1 then
  245. secondplayer = findPlayer(i, player.Name)
  246. end
  247. value = value + 1
  248. end
  249. if victim then
  250. if secondplayer then
  251. for i,v in pairs(victim) do
  252. if v and secondplayer[1] then
  253. if v.Character and secondplayer[1].Character then
  254. if v.Character:findFirstChild('Humanoid').Health ~= 0 and secondplayer[1].Character:findFirstChild('Humanoid').Health ~= 0 then
  255. if v.Character:findFirstChild('HumanoidRootPart') and secondplayer[1].Character:findFirstChild('HumanoidRootPart') then
  256. v.Character:MoveTo(secondplayer[1].Character:findFirstChild('HumanoidRootPart').Positon + Vector3.new(6,3,0))
  257. end
  258. end
  259. end
  260. end
  261. end
  262. else
  263. for i,v in pairs(victim) do
  264. if v and player then
  265. if v.Character and player.Character then
  266. if v.Character:findFirstChild('Humanoid').Health ~= 0 and player.Character:findFirstChild('Humanoid').Health ~= 0 then
  267. if v.Character:findFirstChild('HumanoidRootPart') and player.Character:findFirstChild('HumanoidRootPart') then
  268. v.Character:MoveTo(player.Character:findFirstChild('HumanoidRootPart').Position + Vector3.new(6,2,0))
  269. end
  270. end
  271. end
  272. end
  273. end
  274. end
  275. end
  276. elseif message:sub(1,3) == 'to ' and CheckAdmin(player) == true then
  277. LogAdmin(player,message,nil)
  278. local victim = nil
  279. local value = 0
  280. local aftermessage = string.sub(message, 4)
  281. for i in string.gmatch(aftermessage, "%S+") do
  282. if value == 0 then
  283. victim = findPlayer(i, player.Name)
  284. end
  285. value = value + 1
  286. end
  287. if victim then
  288. for i,v in pairs(victim) do
  289. if v and player then
  290. if v.Character and player.Character then
  291. if v.Character:findFirstChild('Humanoid ')and player.Character:findFirstChild('Humanoid') then
  292. if v.Character.Humanoid.Health ~= 0 and player.Character.Humanoid.Health ~= 0 then
  293. if v.Character:findFirstChild('HumanoidRootPart') and player.Character:findFirstChild('HumanoidRootPart') then
  294. player.Character:MoveTo(v.Character.HumanoidRootPart.Position + Vector3.new(2,2,0))
  295. end
  296. end
  297. end
  298. end
  299. end
  300. end
  301. end
  302. end
  303. end
  304. game.Players.PlayerAdded:connect(function(player)
  305. player.Chatted:connect(function(msg)
  306. onChatted(msg, player)
  307. end)
  308. end)
  309.  
  310. function CheckAdmin(player)
  311. if Admins[player.UserId] or Admins[player.Name] then
  312. return true
  313. else
  314. return false
  315. end
  316. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement