Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Requires 2 parts on workspace with the names "BanPart" and "UnbanPart"
- local Players = game:GetService("Players")
- local BanPart = workspace:FindFirstChild("BanPart")
- local UnbanPart = workspace:FindFirstChild("UnbanPart")
- BanPart.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- local player = Players:GetPlayerFromCharacter(hit.Parent)
- local config = {
- UserIds = {player.UserId}, -- User/s to ban
- ApplyToUniverse = true, -- Does the user get banned from all places connected to this experience or only this place.
- Duration = -1, -- Ban Duration (In seconds) -1 = permanent ban
- DisplayReason = "You have been banned for using exploits.", -- Ban Message to the player
- PrivateReason = "Banned using exploits", -- Private Reason for u
- ExcludeAltAccounts = false -- Do you want this player to get their alt accounts banned too? - false = no
- }
- local success, err = pcall(function()
- Players:BanAsync(config)
- end)
- print(success, err)
- end
- end)
- UnbanPart.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- local config = {
- UserIds = {146640776}, -- Player/s to unban
- ApplyToUniverse = true -- Unban from current place or all places connected to the game
- }
- local success, err = pcall(function()
- Players:UnbanAsync(config)
- end)
- if success then
- print("Player has been unbanned successfuly!")
- else
- print(err)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement