You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Change all selected objects
-
What is the issue? It only changes two parts
Found nothing related to this on Developer hub
-- Change the texture
selected.ChangeTexture.MouseButton1Click:Connect(function()
local recording = CHS:TryBeginRecording("Set texture to mesh")
if not recording then
warn("Recording never finished.")
return
end
local selectedObjects = selection:Get()
for _, mesh in pairs(selectedObjects) do
if mesh:IsA("MeshPart") then
local imageLabel = mesh.SurfaceGui.ImageLabel
local texture = selected.SelectedTile.Image
local offset = selected.SelectedTile.ImageRectOffset
local size = selected.SelectedTile.ImageRectSize
imageLabel.ImageRectOffset = offset
imageLabel.ImageRectSize = size
imageLabel.Image = texture
CHS:FinishRecording(recording, Enum.FinishRecordingOperation.Commit)
end
end
end)