Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(?) Image not changing when depeding on classname

Asked by 4 years ago

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.

0
It could be another part of your code. Did your try viewing output window for an error? Dfzoz 489 — 4y
0
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" Dfzoz 489 — 4y
0
No errors, the part is not a MeshPart UnionOperation etc, its a normal part therotatedo 19 — 4y
0
try doing; v:IsA(classname) User#23252 26 — 4y
0
Seems like a more efficent way to do it, altough it didn't work. Maybe its the image id? But it is vaild. therotatedo 19 — 4y

Answer this question