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

How would it be possible for an auto updating datastore key? [closed]

Asked by 8 years ago
Edited 8 years ago

This question already has an answer here:

Auto updating datastore count?

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.

Also, I've used GetAsync, but that only works if the key has been changed in the same server you're using GetAsync.

Help would be appreciated.

Marked as Duplicate by User#5423, rexbit, and GoldenPhysics

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?