I don't know what is the problem, but when I leave in-studio from playtesting solo, Studio freezes then after some seconds, it works fine again but an error pops up. 14:04:41.768 - Not running script because past shutdown deadline (x10)
I poked around and I think it has something to do with datastores, which I have in my game. here is the code:
local datastore = game:GetService("DataStoreService")
local data1 = datastore:GetDataStore("mymoneydata")
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local greenmoney = Instance.new("NumberValue", leaderstats)
greenmoney.Name = "green_paper"
greenmoney.Value = data1:GetAsync(player.UserId) or 0
data1:SetAsync(player.UserId, greenmoney.Value)
game.Players.PlayerRemoving:connect(function()
data1:SetAsync(player.UserId, greenmoney.Value)
end)
end)
I don't know what this is or how to fix it, and its annoying. please help.
