Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Kicking Script
- local reason = "Reason here"
- script.Parent.Touched:Connect(function(object)
- local player = game.Players:GetPlayerFromCharacter(object.Parent)
- if player ~= nil then
- player:Kick(reason)
- end
- end)
- -- Banning Script
- local reason = "Reason here"
- local dbs = game:GetService('DataStoreService'):GetDataStore('BannedPlayers')
- function BanPlayer(player)
- dbs:SetAsync(tostring(player.UserId), true)
- player:Kick(reason)
- end
- script.Parent.Touched:Connect(function(object)
- local player = game.Players:GetPlayerFromCharacter(object.Parent)
- if player ~= nil then
- BanPlayer(player)
- end
- end)
- -- Keep Players Banned
- local dbs = game:GetService('DataStoreService'):GetDataStore('BannedPlayers')
- local banReason = 'Ban Reason Here'
- game.Players.PlayerAdded:Connect(function(player)
- local status = dbs:GetAsync(tostring(player.UserId))
- if status == true then
- player:Kick(banReason)
- end
- end)
- -- Unban Players
- game:GetService('DataStoreService'):GetDataStore('BannedPlayers'):RemoveAsync('User ID Here')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement