Output editing help

Hello!

I’m going to make this quick. I’ve added a script to my game that does everything I want it too. the only problem is that it displays an error in the output. This kind of bothers me :slight_smile: .

Is there a way to get the output to ignore a specific script? If so, how?

Hope you all are having a great day,
@Mithrandir6440

Can you provide a screenshot of the error I might be able to solve it, and get rid of it completrly

You should use pcall. pcall Ignores errors in your script. For more information you can check this forum post: Pcalls - When and how to use them

Sure, thanks for offering. The script is trying to turn all of the children of a model invisible, including unions, by setting .Transparency = 1. It works; the unions and parts turn invisible, but an error pops up, saying that Transparency isn’t a property of unions.

So… I don’t know what to do. I’m not terribly upset about it since it still works, but it makes editing errors in other scripts hard.

Check if the loop of getting all the Children with IsA("Part") or IsA("UnionOperation"), unless if they made those deprecated?

You can just make the check IsA("BasePart")
Because UnionOperations and MeshParts are also BaseParts.

Yes, I’m using those, but do they need to be in parentheses?

for i, child in ipairs(script.Parent:GetChildren()) do
if child.ClassName == ‘Part’ or ‘UnionOperation’ then

	child.Transparency = 1
	child.CanCollide = false

end

end

here is the script. Like i said, it works, it just puts an error in the output saying: Transparency is not a valid member of Script “Workspace.Base.Buyable.Tower4T.Invisiscript”

The children of script.Parent are both parts and unions

for i, child in ipairs(script.Parent:GetChildren()) do
    if child.ClassName == "Part" or child:IsA("BasePart") then
	    child.Transparency = 1
	    child.CanCollide = false
    end
end

Try this, also

The second conditional statement you’re trying to write isn’t a IsA function (This just basically checks if the child is equal to the given object has)

2 Likes

It worked @JackscarIitt! Thank you so much for solving this problem! Grateful to you :clap:.

1 Like