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

How would I go about creating a datastore that updates automatically across servers?

Asked by 2 years ago

As the title says, I'm having trouble finding a way to have my datastore automatically update across all servers. Granary1 is an IntValue. I don't really know what else to say as I'm completely new to datastores and trying to learn, but this one's stumped me.

local datastore = game:GetService("DataStoreService")
local valueData = datastore:GetDataStore("GranaryStorage")

local Granary1 = script.Parent.Grain.Granary1
Granary1.Value = valueData:GetAsync(valueData)

Granary1.Changed:Connect(function(Changed)
    valueData:SetAsync(valueData, Granary1.Value)
end)
0
Do you mean places instead of servers? bebokhouja2 38 — 2y

Answer this question