I created dozens of images currently used in various parts of my game.
I need to retouch these images, but I don’t want to create new images with a new Id, as I will have a lot of work to put the new Id in each Image field.
How can I replace a current image with another image and keep the same Id of this image?
local old_id = -- put the old one here to be replaced
local new_id = -- put the new id that you want to use to replace the old one
local function HasProperty(v,i)
return pcall(function() return v[i] end)
end
for i, v in pairs(workspace:GetDescendants()) do -- loop through each instance inside of workspace
if HasProperty(v, 'Image') and v.Image == old_id then -- checks if it has the 'Image' property and has the old id
v.Image == new_id -- changes it to the new id
end
end
Sorry for reviving this old post but now you can do so with Packages, which easily allow you to change all assets in a game and push updates to all other places linked