Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. --> ';'
  2. [0]CMDS:
  3. [1]kill (me/plr/others/all)
  4. [2]admin (all/plr)
  5. [3]unadmin (all/plr)
  6. [4]af (autofarm)
  7. [5]saf (stop autofarm)
  8. [6]cmds (chats the cmds list)
  9. --------------------------
  10. If you found any bug please go to this thread and let me know it!
  11. https://v3rmillion.net/showthread.php?tid=690888
  12. --]]
  13. local isAdmin = {[game.Players.LocalPlayer.Name] = true, ["FRIEND1"] = true, ["FRIEND2"] = true} --Admins
  14. local lplr = game.Players.LocalPlayer.Name
  15. local au = false
  16. Owner = game:GetService("Players").LocalPlayer
  17. game:GetService("StarterGui"):SetCore("SendNotification", {
  18. Title = "Sword Simulator Admin";
  19. Text = "Enjoy the script while it lasts!";})
  20.  
  21. function GetPlayer(String) -- Credits to Timeless/xFunnieuss for the get player by string function
  22. local Found = {}
  23. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  24. if v.Name:lower():sub(1, #String) == String:lower() then
  25. table.insert(Found,v)
  26. end
  27. end
  28. return Found
  29. end
  30.  
  31. local function AF()
  32. au = true
  33. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  34. while au do
  35. game.Workspace[lplr].sword.Handle.up.RemoteEvent:FireServer() wait(.1)
  36. if game.Players[lplr].Backpack["sword"] then
  37. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  38. end
  39. end
  40. end
  41.  
  42. local function KA()
  43. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  44. for i,v in ipairs(game.Players:GetPlayers())do
  45. game.Workspace[lplr].sword.Handle.dmg.RemoteEvent:FireServer(workspace[v.Name].Humanoid, 9999999999999999999999)
  46. end end
  47.  
  48. local function KO()
  49. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  50. for i,v in ipairs(game.Players:GetPlayers())do
  51. if v.Name ~= game.Players.LocalPlayer.Name then
  52. game.Workspace[lplr].sword.Handle.dmg.RemoteEvent:FireServer(workspace[v.Name].Humanoid, 9999999999999999999999)
  53. end end
  54. end
  55.  
  56. print'Loaded'
  57. function onChatted(message, player)
  58. if message:sub(1, 6) == ";kill " and isAdmin[player.Name] then
  59. if string.sub(message, 7) == "all" then
  60. KA()
  61. elseif string.sub(message, 7) == "me" then
  62. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  63. ggame.Workspace[lplr].sword.Handle.dmg.RemoteEvent:FireServer(workspace[v.Name].Humanoid, 9999999999999999999999)
  64. elseif string.sub(message, 7) == "others" then
  65. if player.Name == Owner.Name then
  66. KO()
  67. else
  68. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  69. for i,v in ipairs(game.Players:GetPlayers())do
  70. if v.Name ~= player.Name then
  71. game.Workspace[lplr].sword.Handle.dmg.RemoteEvent:FireServer(workspace[v.Name].Humanoid, 9999999999999999999999)
  72. end end
  73. end
  74. else
  75. game:GetService('Players').LocalPlayer.Character.Humanoid:EquipTool(game.Players[lplr].Backpack["sword"])
  76. for i,v in pairs(GetPlayer(string.sub(message, 7)))do
  77. local plr = v.Name
  78.  
  79. for i,p in ipairs(game.Players:GetPlayers())do
  80. if p.Name ~= game.Players.LocalPlayer.Name then
  81. game.Workspace[lplr].sword.Handle.dmg.RemoteEvent:FireServer(workspace[v.Name].Humanoid, 9999999999999999999999)
  82. end end end
  83. end
  84. end
  85.  
  86. if message:sub(1, 7) == "/e kill" and isAdmin[player.Name] then
  87. KA()
  88. end
  89.  
  90. if message:sub(1, 6) == ";cmds" then
  91. if player.Name == Owner.Name then
  92. wait(0.2)
  93. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("[System]CMDS: [1]kill(me/plr/others/all), [2]admin(all/plr), [3]unadmin(all/plr), [4]af(autofarm), [5]saf(stop autofarm), [6]cmds", "All")
  94. elseif isAdmin[player.Name] and player.Name ~= Owner.Name then
  95. wait(0.2)
  96. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("[System]CMDS: [1]kill(me/plr/others/all), [2]admin(all/plr), [3]unadmin(all/plr), [4]cmds", "All")
  97. end
  98. end
  99.  
  100. if message:sub(1, 7) == ";admin " and isAdmin[player.Name] then
  101. if string.sub(message, 8) == "all" and isAdmin[Owner.Name] then
  102. if isAdmin[Owner.Name] then
  103. for i,plrs in ipairs(game:GetService('Players'):GetChildren())do
  104. isAdmin[plrs.Name] = {true}
  105. end
  106. wait(0.2)
  107. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("[System]Everyone is now Admin!", "All")
  108. end
  109. else
  110. for i,v in pairs(GetPlayer(string.sub(message, 8)))do
  111. local plr = v.Name
  112. if isAdmin[plr] then
  113. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("[System]"..plr.." is already Admin!", "All")
  114. else
  115. isAdmin[plr] = {true}
  116. wait(0.2)
  117. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("[System]"..plr.." is now Admin!", "All")
  118. end
  119. end
  120. end
  121. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement