So I made a post earlier in regarding to this, and it was fixed eventually for a little while by using “game:bindtoclose”, and with a coroutine you could loop trough all the players to store their data by using “setasync”. But now for some reason it just isn’t working anymore in roblox studio. If I join my game on the platform it works perfectly fine though, just not in roblox studio.
I have tried to find a solution by searching trough the dev forums, but I couldn’t find anything that would fix my problem. So I hope somebody here can.
game:BindToClose(function()
print('Started.')
local coroutines={};
for _,v in game.Players:GetPlayers()do
local c=coroutine.create(SaveData);
table.insert(coroutines,c);
coroutine.resume(c,v);
end
for _,v in next,coroutines do
repeat task.wait()until coroutine.status(v)=='dead';
end
print('Finished.');
end)
I was testing out my code, and I tried to find to see where thing started to go wrong, and basically nothing will run anymore after setasync is being used. But this poblem only occurs in roblox studio, and I am just very confused.