Nogalo
(Nogalo)
March 7, 2021, 7:59am
#1
Greetings,
local success, errormessage = pcall(function()
print "async"
myDataStore:SetAsync(player.UserId.."Data",Data2)
print "asynced"
end)
last few days this same script sometimes works sometimes doesn’t. When i first made it worked fine. Then it would only print “async” but not “asynced” and wouldn’t save data. Then yesterday it worked fine again and this morning it worked fine until like 30 min ago it stopped working again, printing only “async”. Is Roblox the issue or is it me?
Thanks for your time
C1_PH3R
(C1P)
March 7, 2021, 8:01am
#2
I don’t know, a lot about programming, but when it doesn’t work again, did you close the server?
Nogalo
(Nogalo)
March 7, 2021, 8:02am
#3
nah i’m using it in studio only atm
C1_PH3R
(C1P)
March 7, 2021, 8:03am
#4
But have you tried it in the game, without being in roblox studio?
Nogalo
(Nogalo)
March 7, 2021, 8:04am
#5
well ok i’mma try now but i don’t think it will make a difference tbh
Nogalo
(Nogalo)
March 7, 2021, 8:07am
#6
touche good sir, you were right. Seems to save fine in game.
Kaid3n22
(Kaiden)
March 7, 2021, 8:15am
#7
if you want to save in studio (not just in game), you can use game:BindToClose()
like this:
game:BindToClose(function()
for i, player in pairs(game.Players:GetPlayers()) do
--saving code
end
end)
This is because studio closes the game and doesn’t remove the player.
Nogalo
(Nogalo)
March 7, 2021, 8:15am
#8
thanks for the tip, tho it doesn’t matter too much, so long as it works in game
Kaid3n22
(Kaiden)
March 7, 2021, 8:16am
#9
true, but thought it helps to save in studio too.