I'm making an explorer script and I'm doing a simple if sentence to check the classname, and I put the icon of the object depending on the classname.
HasChildren.TextXAlignment = Enum.TextXAlignment.Left
if v.ClassName == "Workspace" then
Icon.Image = "rbxassetid://216049808"
elseif v.ClassName == "Part" then
Icon.Image = "rbxassetid://413369029"
end
I've been trying to solve this for 20 minutes now, to no avail. Ingame the icon just doesn't show up, what did I do wrong? Thanks for answering.

5 comments
It could be another part of your code. Did your try viewing output window for an error?
Some blocks like meshparts or unionoperations doesnt count as parts, which in the case doesnt result in an error but doesnt change the image either. If you are trying to check them along with normal parts you could use instance:IsA("BasePart") instead of instance.ClassName == "Part"
No errors, the part is not a MeshPart UnionOperation etc, its a normal part
try doing; v:IsA(classname)
Seems like a more efficent way to do it, altough it didn't work. Maybe its the image id? But it is vaild.