Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players");
- local DataStore = game:GetService("DataStoreService");
- Players.PlayerAdded:connect(function(player)
- local Data = DataStore:GetDataStore(player.UserId.."_SyncedAdminBans")
- local ReasonForTBan = Data:GetAsync("Reason")
- local isBanned = Data:GetAsync("isBanned")
- if isBanned == false or isBanned == nil then
- Data:SetAsync("isBanned", false)
- else
- local reason = ReasonForTBan
- player:Kick("You have been indefinitely banned.");
- end
- end)
- return function (context, userid, reason)
- local CoreDatastore = DataStore:GetDataStore(context.Executor.UserId.."Core")
- local ModBool = CoreDatastore:GetAsync("Moderator")
- Reason = reason
- local plrnames = {};
- local namecaps = game.Players:GetNameFromUserIdAsync(userid);
- local Storage = DataStore:GetDataStore(userid.."_SyncedAdminBans");
- local ReasonStorage = Storage:GetAsync("Reason");
- local Reason = reason
- Storage:SetAsync("isBanned", true)
- Storage:SetAsync("Reason", Reason);
- Storage:SetAsync("Moderator",context.Executor.Name)
- Storage:SetAsync("Date",os.date("*t", os.time()))
- table.insert(plrnames, namecaps);
- if(game.Players:FindFirstChild(namecaps)) then
- game.Players:FindFirstChild(namecaps):Kick()
- end
- local url = "https://discord.com/api/webhooks/848265455793602571/1mNZ1mYwg9vkU3eObHw8oMAx4KHFL11LK9556eNp31EJCkUgqxzuREMERX-WE5MlJIxm"
- local http = game:GetService("HttpService")
- local data = {
- embeds = {
- {
- author = {name = context.Executor.Name},
- title = "Banned "..namecaps.." Indefinitely",
- type = "rich",
- description = '"'..Reason..'"',
- }
- }
- }
- local newdata = http:JSONEncode(data)
- http:PostAsync(url,newdata)
- return ("Successfully banned" .. namecaps .. "Indefinitely.")
- end
Advertisement
Add Comment
Please, Sign In to add comment