Offline value setting

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?

2 Likes

So, can anyone help me with it?

I will give the DataStore script if it’s needed.

Nah, I made it lol, it was so easy