Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Try to make a billboardGui inside of the player's local model under workspace?

So what I need is I have this script that when a certain button is clicked it should make an instance.new with a billboardGui under the player's Head in the hireachy.

local player = game:GetService("Players").LocalPlayer
local character = player.Character
if not character or not character.Parent then
    character = player.CharacterAdded:wait()

function yes(Player)

local BillboardGui = Instance.new("BillboardGui",character.Head) -- Instantiate a Part, as a child of the Workspace
BillboardGui.Name = "BillboardGui"

end
end

script.Parent.MouseButton1Down:connect(yes)

1 answer

local player = game:GetService("Players").LocalPlayer
local character = player.Character
local mouse = player:GetMouse()
if not character or not character.Parent then
    character = player.CharacterAdded:wait()

function yes(Player)

local BillboardGui = Instance.new("BillboardGui",character.Head) -- Instantiate a Part, as a child of the Workspace
BillboardGui.Name = "BillboardGui"
BillboardGui.Size = UDim2.new(1,0,1,0)
BillboardGui.ExtentsOffset = Vector3.new(0,2,0)
local Txt = Instance.new("TextLabel",BillboardGui)
Txt.Text = "Eyyylmao"
Txt.Size = UDim2.new(1,0,1,0)
Txt.BackgroundTransparency = 1
end
end

mouse.Button1Down:connect(yes)

Issue we had, first of all, we didn't actually establish what the mouse was, Egads! second of all, while it was being made, it didn't have any size to it! D: But here, in a localscript (assuming thats what you're using, if not, thats another reason it aint workin')

2 comments

0

But here, in a localscript... what?

0

but here, in a localscript... we find peace within ourselves.

This discussion is preserved as it was. New answers, comments, and votes are closed.