Insert Service not inserting most recent updated model?

I am trying to use insert service to insert a folder of IDs into my game. These IDs change periodically and thus the game needs to continually have the most recent set of audios IDs. This works absolutely perfect in studio whatsoever but when it comes to joining in my game from the roblox website, it doesn’t work.

My code on a server sided script:

while true do
	local InsertService = game:GetService("InsertService")
	local success, model = pcall(InsertService.LoadAsset, InsertService, 9166284874)
	if success and model then
		print("Model loaded successfully")
		model.Parent = game.Workspace
		local ID1 = model:GetChildren()[1]:GetChildren()[1]
		print(ID1.Value, " | ", model:GetChildren()[1]:GetChildren()[1].Value)
--Print the most recent ID.


		print("Model failed to load!")


Video showing it working in studio just fine:

Video showing it NOT working in game like it SHOULD:

I’ve waited much longer in time to see if it would have any delay and change than in the second video but it never changed.

Script to test for yourself: (you must make your own model of “Folder”)
Insert Service.rbxm (1.4 KB)

Why is this happening and how can I fix this problem?

For anybody else that might run into this problem:

  1. Get the latest version number of ur model by using this:

  2. Take that number and use insert service below to get the latest model.

Quick write up:

    local InsertService = game:GetService("InsertService")
	local i = game:GetService("InsertService"):GetLatestAssetVersionAsync(IDHERE)
	local l = game:GetService("InsertService"):LoadAssetVersion(i)
	--local l = game:GetService("InsertService"):LoadAsset(IDHERE)
	l.Parent = game.Workspace
	local ID1 = l:GetChildren()[1]:GetChildren()[1]
	print(ID1.Value, " | ", l:GetChildren()[1]:GetChildren()[1].Value)
1 Like