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.

2 comments

0

Why not use SetAsync?

0

Already solved.... kthx