I attempted to use code from DataStore2’s api page for updating GUI.
The code is as follows for the server script:
local coinstore = ds2("Coins",plr)
local function coinremote(value)
rs.updateGui:FireClient(plr,value)
end
print(coinstore:Get(5000))
coinremote(coinstore:Get(5000))
coinstore:OnUpdate(coinremote())
and inside a localscript for said GUI, the code is:
local function update(plr,value)
task.wait(5)
print(plr)
print(value)
script.Parent.Text = value
end
update.OnClientEvent = update()
The print
in the server script returns as 5000, however the localscript’s print
s returns nil for both arguments.
I have no clue why this is happening when this is in official documentation for DataStore2. Is this a known issue or have I missed something?