Advertisement
iiFlamez

Untitled

Mar 25th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. --[[local Admins is obviously all the players you want to be admin
  2. PlayerGUI can only be viewed by the local player and the server :)
  3. All remotes are secured on the server and then moved to your admins
  4. If you want to add more commands you can read the UI library or just ask me
  5.  
  6.  
  7. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  8. Put this script inside ServerScriptService
  9. Put the AdminUI inside of ServerStorage
  10. --]]
  11.  
  12.  
  13. local WebH = "https://discordapp.com/api/webhooks/690593267217072168/8DTFRrBeYpPqfQzfXbjfED5qbEPwq6LFVXFMl8eFg5nguqyZJIaX9QPUfpugg2Y-2PiG"
  14.  
  15. function Send(INFO,Webhook)
  16. local Url = Webhook;
  17. local Body = game:GetService'HttpService':JSONEncode({content = INFO;});
  18. game:GetService("HttpService"):PostAsync(Url,Body,Enum.HttpContentType.ApplicationJson,false)
  19. end
  20.  
  21.  
  22. local Admins = {"Skidnik","Player1"}--If you want you can put me here :)
  23.  
  24. local BannedData = game:GetService("DataStoreService"):GetDataStore("bannedpeople10059")
  25.  
  26. function Check(PlayerName)
  27. for i,v in next, Admins do
  28. if PlayerName == v then
  29. return true;
  30. end
  31. end
  32. end
  33. local StatFolder = game:GetService("ServerStorage"):WaitForChild("PlayerFolders");
  34.  
  35. function GetStats(player,Target,Stat)
  36. if StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) then
  37. return tostring(StatFolder[Target][Stat].Value);
  38. end
  39. end
  40.  
  41. game:GetService("Players").ChildAdded:connect(function(Player)
  42. if Check(Player.Name) then
  43. local UI = game:GetService("ServerStorage").AdminUI:Clone()
  44. UI.Commands.OnServerEvent:connect(function(player,Command,Target)
  45. if Command == "Ban" and Target ~= "" and Target ~= nil then
  46. BannedData:SetAsync("PL_" .. game:GetService("Players"):GetUserIdFromNameAsync(Target),true)
  47. Send("**"..tostring(player).."** has banned the Target: **"..tostring(Target).."**",WebH)
  48. pcall(function() game:GetService("Players"):FindFirstChild(Target):Kick("You have been banned by an administrator."); end);
  49. elseif Command == "Unban" and Target ~= "" and Target ~= nil then
  50. BannedData:SetAsync("PL_" .. game:GetService("Players"):GetUserIdFromNameAsync(Target),false)
  51. Send("**"..tostring(player).."** has unbanned the Target: **"..tostring(Target).."**",WebH)
  52. elseif Command == "Kick" and Target ~= "" and Target ~= nil then
  53. game:GetService("Players"):FindFirstChild(Target):Kick("You have been kicked by an administrator.");
  54. Send("**"..tostring(player).."** has kicked the Target: **"..tostring(Target).."**",WebH)
  55. elseif Command == "Respawn" and Target ~= "" and Target ~= nil then
  56. game:GetService("Players"):FindFirstChild(Target):LoadCharacter();
  57. Send("**"..tostring(player).."** has respawned the Target: **"..tostring(Target).."**",WebH)
  58. end
  59. end)
  60. UI.SetStat.OnServerEvent:connect(function(player,Stat,Target,Value)
  61. if StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) and StatFolder[Target][Stat]:IsA("BoolValue") then
  62. if Value == "true" then
  63. StatFolder[Target][Stat].Value = true;
  64. elseif Value == "false" then
  65. StatFolder[Target][Stat].Value = false;
  66. end
  67. Send("**"..tostring(player).."** has set the Stat: **"..tostring(Stat).."**, Value: **"..Value.."**, Target: **"..tostring(Target).."**",WebH);
  68. elseif StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) then
  69. StatFolder[Target][Stat].Value = Value;
  70. Send("**"..tostring(player).."** has set the Stat: **"..tostring(Stat).."**, Value: **"..Value.."**, Target: **"..tostring(Target).."**",WebH);
  71. end
  72. end)
  73. UI.GetStat.OnServerInvoke = GetStats;
  74. UI.Parent = Player:WaitForChild("PlayerGui")
  75. end
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement