Also, does datastore work in studio?
I believe you need to enable Studio Access to API Services in Configure Game for it to function in studio.
1 Like
I turned studio access to API Services on and I went into server and it gave me 12 wood (cause the script did that) then I left and made it into a text and rejoined and it didn’t save. Can you help me?
Set the Wood value in PlayerStats to what the DataStore value is for it when the player joins.
Before:
local text = script.Parent
local plr = game.Players.LocalPlayer
while true do
wait() -- This prevents it from causing a script error or shutdown. DON'T DELETE IT.
text.Text = plr:WaitForChild("PlayerStats").Wood.Value
plr.PlayerStats.Wood.Value = 12
end
After:
local text = script.Parent
local plr = game.Players.LocalPlayer
while true do
wait() -- This prevents it from causing a script error or shutdown. DON'T DELETE IT.
text.Text = plr:WaitForChild("PlayerStats").Wood.Value
-- plr.PlayerStats.Wood.Value = 12
end
That’s what I mean.