Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[local Admins is obviously all the players you want to be admin
- PlayerGUI can only be viewed by the local player and the server :)
- All remotes are secured on the server and then moved to your admins
- If you want to add more commands you can read the UI library or just ask me
- IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
- Put this script inside ServerScriptService
- Put the AdminUI inside of ServerStorage
- --]]
- local WebH = "https://discordapp.com/api/webhooks/690593267217072168/8DTFRrBeYpPqfQzfXbjfED5qbEPwq6LFVXFMl8eFg5nguqyZJIaX9QPUfpugg2Y-2PiG"
- function Send(INFO,Webhook)
- local Url = Webhook;
- local Body = game:GetService'HttpService':JSONEncode({content = INFO;});
- game:GetService("HttpService"):PostAsync(Url,Body,Enum.HttpContentType.ApplicationJson,false)
- end
- local Admins = {"Skidnik","Player1"}--If you want you can put me here :)
- local BannedData = game:GetService("DataStoreService"):GetDataStore("bannedpeople10059")
- function Check(PlayerName)
- for i,v in next, Admins do
- if PlayerName == v then
- return true;
- end
- end
- end
- local StatFolder = game:GetService("ServerStorage"):WaitForChild("PlayerFolders");
- function GetStats(player,Target,Stat)
- if StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) then
- return tostring(StatFolder[Target][Stat].Value);
- end
- end
- game:GetService("Players").ChildAdded:connect(function(Player)
- if Check(Player.Name) then
- local UI = game:GetService("ServerStorage").AdminUI:Clone()
- UI.Commands.OnServerEvent:connect(function(player,Command,Target)
- if Command == "Ban" and Target ~= "" and Target ~= nil then
- BannedData:SetAsync("PL_" .. game:GetService("Players"):GetUserIdFromNameAsync(Target),true)
- Send("**"..tostring(player).."** has banned the Target: **"..tostring(Target).."**",WebH)
- pcall(function() game:GetService("Players"):FindFirstChild(Target):Kick("You have been banned by an administrator."); end);
- elseif Command == "Unban" and Target ~= "" and Target ~= nil then
- BannedData:SetAsync("PL_" .. game:GetService("Players"):GetUserIdFromNameAsync(Target),false)
- Send("**"..tostring(player).."** has unbanned the Target: **"..tostring(Target).."**",WebH)
- elseif Command == "Kick" and Target ~= "" and Target ~= nil then
- game:GetService("Players"):FindFirstChild(Target):Kick("You have been kicked by an administrator.");
- Send("**"..tostring(player).."** has kicked the Target: **"..tostring(Target).."**",WebH)
- elseif Command == "Respawn" and Target ~= "" and Target ~= nil then
- game:GetService("Players"):FindFirstChild(Target):LoadCharacter();
- Send("**"..tostring(player).."** has respawned the Target: **"..tostring(Target).."**",WebH)
- end
- end)
- UI.SetStat.OnServerEvent:connect(function(player,Stat,Target,Value)
- if StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) and StatFolder[Target][Stat]:IsA("BoolValue") then
- if Value == "true" then
- StatFolder[Target][Stat].Value = true;
- elseif Value == "false" then
- StatFolder[Target][Stat].Value = false;
- end
- Send("**"..tostring(player).."** has set the Stat: **"..tostring(Stat).."**, Value: **"..Value.."**, Target: **"..tostring(Target).."**",WebH);
- elseif StatFolder:FindFirstChild(Target) and StatFolder[Target]:FindFirstChild(Stat) then
- StatFolder[Target][Stat].Value = Value;
- Send("**"..tostring(player).."** has set the Stat: **"..tostring(Stat).."**, Value: **"..Value.."**, Target: **"..tostring(Target).."**",WebH);
- end
- end)
- UI.GetStat.OnServerInvoke = GetStats;
- UI.Parent = Player:WaitForChild("PlayerGui")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement