#Datastore problem

1 messages · Page 1 of 1 (latest)

wise star
#

This part of the script is where the data is being stored and retrieved doesnt work. It saves right when you join the game, however i want it to save when you leave

#

wait i might be able to fix it

#

i tried executing the first part after the player left but it still didnt work

#

i put it in a while loop but it crashed studio

fair geode
#

Of course studio crash if you put while loop without wait.

#

Why do you use "Get" in playerRemoving instead Set?

wise star
#

i forgot

fair geode
#

"Get" is not saving

wise star
#

set isnt saving either

#

it saves once at the start of the game

#

this must be a long message

fair geode
#

I haven't touched Datastore yet.

But i belive u want to use

local data
local sucess, err = pcall(function()
  data = coinStore:GetAsync(key)
end
if sucess then
  money.Value = data
end
-- on Removing:
local sucess, err = pcall(function()
  coinStore:SetAsync(key, coins.Value)
end)
wise star
#

thanks

#

datastore is so annoying

paper prawnBOT
#

studio** You are now Level 2! **studio

wise star
#

it didnt work

urban spire
#

game:bindtoclose