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

How do I insert a billboard gui into multiple parts with the same name via script? [Solved]

Asked by 3 years ago
Edited 3 years ago

I have multiple parts with the same name grouped, and I wanted to know how to insert a billboard gui into all of the parts with the same name via script. This is what I currently have:

model = game.Workspace.Model
nameof = "Part"
local billboard = Instance.new("BillboardGui")
billboard.Parent = game.Workspace
billboard.Name = "Test"

for i,v in pairs(model:GetChildren()) do
    if v.Name == nameof then 

        billboard:Clone(v) 

    end
end

Thank you for your time.

0
Do you get any errors in the output? Or does it just not work? 2_MMZ 1059 — 3y
0
It just doesn't work. There are no errors in output. Zeta_Dev 34 — 3y
0
maybe try using ipairs? kjljixx 42 — 3y
0
On line 10, try doing billboard:Clone().Parent = v. I've not seen Clone(x) used to set the parent. radiant_Light203 1166 — 3y

Answer this question