Mannequin shirt and pants changes wont get visible

Hey,
So, i wanted to make a mannequin with clothing where the people can change the clothing id.
The Shirts and pants on the mannequin wont show up and the id is not wrong because you can purchase the item.
Does anyone know the issue?

game.ReplicatedStorage.ChangeClothes.OnServerInvoke = function(plr,shirtId,pantsId)
	script.Parent.Parent.PantsId.Value = pantsId
	script.Parent.Parent.ShirtId.Value = shirtId
end

while wait() do
	script.Parent.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" ..script.Parent.Parent.PantsId.Value
	script.Parent.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" ..script.Parent.Parent.ShirtId.Value
end

I remade your script as the loop was unnecessary and you should use a RemoteEvent instead of RemoteFunction unless you’re planning on returning a value.
Other than that just make sure your path is correct (line 2/3).

game.ReplicatedStorage.ChangeClothes.OnServerInvoke = function(plr, shirtId, pantsId)
	script.Parent.Pants.PantsTemplate = pantsId
	script.Parent.Shirt.ShirtTemplate = shirtId
	return nil
end

You can’t change shirts/pants by changing the ID property.

You will need to use InsertService:LoadAsset instead.