How would you update a place created using :CreatePlaceAsync()?

Hi, there!

I’m creating a sandbox game, where players can create their own farms, and I thought the AssetService would be a good starting point for this. I have since began to ponder, how would I push updates to a player’s created game?

Would using ModuleScripts that update from the toolbox via some kind of version history be a viable solution? Or perhaps Packages?

I don’t really know what you want. Do you want their builds to be uploaded as their place? if yes then this is not possible because your script will need some type of authorization to upload the place using their account and if you want just save to datastores when player can load it and edit it.

You could also find way to upload models on your account so players can get it but I’m not sure about this one.

I have a current approach, a really basic implementation that does the job (my concern is mainly with how appropriate this is, if the game were to become visibly popular).

I publish a folder to Roblox, containing folders of paths / parents. In each, are the respective assets necessary for the game that get parented to their path. In the template place, a script that inserts that folder, parents everything and then code runs (alas, a playable game with content that updates).

--[[

	AUTO_UPDATE
		-> A script responsible for handling the current
		version of Farm Life.

	> Contributors:
		@ turboscare

--]]


local Services = {
	InsertService = game:GetService("InsertService");
	
	ServerStorage = game:GetService("ServerStorage");
}


function Update()
	local version = Services.InsertService:LoadAsset(require(script:WaitForChild("ID")))
	if version:IsA("Model") then
		local model = version
		version = version:FindFirstChild("Farm Life")
		version.Parent = Services.ServerStorage

		model:Destroy()
	end

	for _, folder in next, version:GetChildren() do
		if folder.Name == "StarterPlayerScripts" then
			for _, child in next, folder:GetChildren() do
				child.Parent = game:GetService("StarterPlayer"):WaitForChild("StarterPlayerScripts")
			end
			
		else
			for _, child in next, folder:GetChildren() do
				child.Parent = game:GetService(folder.Name)
			end
		end
	end
end
Update()
1 Like