:Remove() is deprecated, use :Destroy() instead. With how your code is right now, if theres an object named “SelectionBox” under workspace then it would get destroyed, are you sure you have the right parent?
You’ll need to loop through the workspace to find everything that shares that name.
Here’s an example using ipairs (since :GetDescendants() returns an array):
local Workspace = game:GetService('Workspace')
for Index, Part in ipairs(Workspace:GetDescendants()) do
if Part.Name == 'Name' then
Part:Destroy()
end
end
Trying it later, are you experiencing this problem? Roblox is mistaking properties for children. This happens on a lot of my scripts and forces me to make unnecessary variables for things like “script.Parent”
No, I am not experiencing your issue, never have.
And, I’m pretty sure you get that error because models doesn’t have a Transparency property, check if it’s a basepart before setting it.