Hi, I’m using DataStore in my game to suspend player when he’s used exploits with this script:
game.Players.PlayerRemoving:connect(function(player)
local datastore = game:GetService(“DataStoreService”):GetDataStore(player.UserId…“Data”)
local statstorage = player:FindFirstChild(“Banned”):GetChildren()
for i = 1, #statstorage do
datastore:SetAsync(statstorage[i].Name, statstorage[i].Value)
end
end)
So, does anyone knows how can I change the stats when player is offline?