Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DataStore = game:GetService("DataStoreService")
- local DSName = DataStore:GetDataStore("Bamboo")
- game.Players.PlayerAdded:Connect(function(Player)
- local Data = Player:WaitForChild("Data")
- local Banned = Data:WaitForChild("Banned")
- Banned.Value = DSName:GetAsync(Player.UserId)
- DSName:SetAsync(Player.UserId, Banned.Value)
- print("Data found")
- end)
- game.Players.PlayerRemoving:Connect(function(Player)
- DSName:SetAsync(Player.UserId, Player.Data.Banned.Value)
- end)
- game.Players.PlayerAdded:Connect(function(Player)
- local Data = Player:WaitForChild("Data")
- local Banned = Data:WaitForChild("Banned")
- if Player.Data.BannedTime.Value <= 5 then
- print("Time less than 5")
- Player.Data.BannedTime.Value = os.time()
- elseif Player.Data.BannedTime.Value >= 5 then
- print("Time greater than 5")
- if os.time() >= Player.Data.BannedTime.Value + 86400 then
- print("Time hasnt been served")
- Player.Data.BannedTime.Value = 0
- Player.Data.Banned.Value = false
- else
- print("Kicked")
- Player:Kick("You have been Banned for logging.")
- end
- end
- if Banned.Value == true then
- print("Value true")
- Player:Kick("You have been banned for a day.")
- else
- print("You not banned")
- Banned.Value = false
- end
- end)
- game.Players.PlayerRemoving:Connect(function(Player)
- Player.CharacterAdded:Connect(function(Character)
- local inCombat = Player:WaitForChild("InCombat")
- if inCombat.Value == true then
- print("Player in combat")
- if Player.Data.BannedTime.Value <= 5 then
- print("Time is less than and equal to 5")
- Player.Data.BannedTime.Value = 500
- elseif Player.Data.BannedTime.Value >= 5 then
- print("Player time is greater than 5 again")
- if os.time() >= Player.Data.BannedTime.Value + 86400 then
- print("Time not server")
- Player.Data.BannedTime.Value = 0
- Player.Data.Banned.Value = false
- else
- Player:Kick("You have been Banned for logging.")
- end
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment