Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Auto updating datastore count? [closed]

Asked by 8 years ago

I'm trying to make the following script auto update a datastore value. I am using multiple servers / universes that change the datastore value which is the problem, i'd need to reset my character just to see the new update.

Here is what i've tried:

while wait(3) do 
local ds = game:GetService("DataStoreService"):GetDataStore("InfectedPlaylistCount")
ds:UpdateAsync("val", function(Value)
script.Parent.Text = tostring(Value.." in playlist")
end)
end

I've tried making "ds" local, but no luck. The script gives me a value, but only gives me 1 value and then that's it, i'd have to reset to see an updated version.

Help would be appreciated.

0
Why not use SetAsync? shayner32 478 — 8y
0
Already solved.... kthx V_ChampionSSR 247 — 8y

Locked by evaera, chess123mate, and TheHospitalDev

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?