local DataStore = game:GetService("DataStoreService"):GetDataStore("Time") game.Players.PlayerRemoving:connect(function(player) local label = player.PlayerGui.TimeLeft.Frame.TimeLeftLabel local ready = player.PlayerGui.TimeLeft.Frame.Ready.ReadyToVisit local key = "user_" .. player.userId --we want to give 50 points to users each time they visit DataStore:UpdateAsync(key, function(oldValue) local newValue = label.Value or oldValue or 30 --oldValue might be nil return newValue end) --datastore end end)
I want to update the value when you leave, but I can't get an output and it doesn't seem to work. Help?
(Why do I keep on getting thumbs downs?)