Play Solo doesn't yield long enough for yielding functions to process with such events like PlayerRemoving

What’s happening: Play Solo will not process functions that yield like DataStore:UpdateAsync before the player leaves test. THIS DOES HOWEVER WORK ON LIVE GAMES

When it started: In the span of the last 3 Months.

Code used in test:

function UpdateData(player,newdata,newdata2)
	print("Updating Data")
	local key = player.UserId.."_data"
	local success, callback = pcall(function()
		pDataStore:UpdateAsync(key,function(old)
			return newdata
		end)
	end)
	print("Updated Data, throwing more information")
	if success == false then
		print("Data error, retrying @ "..callback)
		return UpdateData(player,newdata)
	elseif success == true then
		print("Saved data successfully!")
	end
end

Play Solo:

image

Local Server Test:

image

  1. Write any saving function or PlayerRemoving processing function and use the event PlayerRemoving to fire the function.

  2. Test in Play Solo and compare to Live Games / Local Servers

COMPUTER SPECIFICATIONS

CPU: i7-8700k
GPU: RTX 2080
Memory: 32 GB

Note: Even if this wasn’t intentional behavior, it is still nice to have this work, because it makes debugging easier to make new data systems.

2 Likes