Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local Unbansage = 'Succesfully'
- local DataStoreService = game:GetService("DataStoreService")
- local BansDataStore = DataStoreService:GetDataStore("BansDataStore")
- local userId = player.UserId
- -- Function to unban a user
- local function unban(userId)
- local success, errorMessage = pcall(function()
- -- Attempt to get the current list of banned users
- local bannedUsers = BansDataStore:GetAsync("BannedUsers") or {}
- -- Check if the user is currently banned
- if bannedUsers[userId] then
- -- User is found in the ban list, remove them
- bannedUsers[userId] = nil
- -- Update the DataStore with the modified list
- BansDataStore:SetAsync("BannedUsers", bannedUsers)
- print("Succesfully unbanned " .. player.Name .. " - Made by cpkq")
- else
- -- User was not found in the ban list
- print("The user " .. player.Name .. " was not found - Made by cpkq")
- end
- end)
- if not success then
- warn('Failed to unban' .. player.Name .. ' - Made by cpkq')
- end
- end
- unban(userId)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement