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

Help me! Instance.new("BillboardGui") is not creating Billboard gui.. Why?

Asked by 5 years ago

Hi everyone,

Why this script insnt creating BillboardGui?

game.Workspace = Instance.new("BillboardGui")

Am I forgot something? Am I did something wrong? If i did that wrong, please make it correct with explain.

Thx

3 answers

Log in to vote
1
Answered by 5 years ago

Try This!

local billboardgui = Instance.new("BillboardGui")
billboardgui.Parent = game.Workspace

Or

Instance.new("BillboardGui", game.Workspace) --put the objects parent after the comma.
0
Hope it helps! 0_Halloween 166 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

What you're doing here is pretending defining game.Workspace as a variable and trying to replace it as a BillboardGui, so it's not gonna work on a lot of levels :)

Instead, make BillboardGui's Parent the Workspace. Or in other words, put the BillboardGui inside the Workspace. You can do this easily because Instance has another property where you put the Parent. Like this:

Instance.new("BillboardGui",game.Workspace)
Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

That isn't how you create things.

You should either set the Parent property of BillboardGui after creating it to workspace, or put workspace as the second argument of Instance.new (which is not recommended)

So, 1st way:

local bg = Instance.new("BillboardGui")
bg.Parent = workspace

2nd, (not recommended by most people because it decreases the performance by like 0.004 seconds or more depending on what you do) way:

local bg = Instance.new("BillboardGui", workspace)

Answer this question