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
Try This!
local billboardgui = Instance.new("BillboardGui") billboardgui.Parent = game.Workspace
Or
Instance.new("BillboardGui", game.Workspace) --put the objects parent after the comma.
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)
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)