Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DataStoreService = Game:GetService("DataStoreService")
- local persistentBannedList = DataStoreService:GetDataStore("PersistentBannedList")
- -- this syntax is an alternate way to write
- -- data within tables, it still works though
- local minimumBannedList = {
- ["Tinfold"] = true;
- ["chucky4523"] = true;
- ["x1op"] = true;
- }
- function isPlayerBanned(player)
- return minimumBannedList[player.Name]
- or persistentBannedList:GetAsync(player.Name)
- end
- function setBanStatus(player, status)
- minimumBannedList[player.Name] = status
- persistentBannedList:SetAsync(player.Name, status)
- end
- script.SetBanStatus.OnInvoke = setBanStatus
- function onPlayerAdded(player)
- if isPlayerBanned(player) then
- player:Kick()
- end
- end
- Game:GetService("Players").PlayerAdded:connect(onPlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement