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
Sadly, you cannot. You cannot change a image and keep the same ID. If in the focus of decals, you will have to create a new decal to get a new image resulting in the ID being different.
I don’t think this would work since this is placed in Studio and is not being placed within Roblox decal files. It may work since I am not a scripter, I am a website developer but it is worth a try.
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