Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ban = {}
- local players = game:GetService("Players")
- local dataStore = game:GetService("DataStoreService")
- local bans = dataStore:GetDataStore("bans5")
- function ban.checkPlayer(player)
- local banned = bans:GetAsync(player.UserId)
- if banned then
- local reason,TIME = banned[1],banned[2]
- if TIME and TIME < os.time() then
- return false,'User surpassed ban length'
- elseif TIME then
- player:Kick("You are banned! reason: "..reason.." For: ("..((TIME-os.time())/60).." minutes)")
- else
- player:Kick("You are banned! reason: "..reason.." (permanently)")
- end
- end
- end
- function ban.applyBan(ID,reason,TIME)
- if TIME then
- TIME = (TIME*60) + os.time()
- else
- TIME = false
- end
- bans:SetAsync(ID,{reason,TIME})
- end
- return ban
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement