What do you want to achieve? Keep it simple and clear!
Get rid of errors.
What is the issue? Include screenshots / videos if possible!
Attempt to concatenate nil with string - line 7
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
nothing…
local BanData = game:GetService("DataStoreService"):GetDataStore("Bans")
game.Players.PlayerAdded:Connect(function(player)
if BanData:GetAsync(player.UserId) then
local Length = BanData:GetAsync(player.UserId).Length
local Date = os.date("*t")
if Length >= Date.year..Date.month..Date.week..Date.day..Date.hour then -- problem here
BanData:RemoveAsync(player.UserId)
end
player:Kick("YOU HAVE BEEN BANNED: REASON: ["..BanData:GetAsync(player.UserId).Reason.."] LENGTH TIME: ["..Length.."]")
end
end)