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

How do you make an overhead gui correctly?

Asked by 4 years ago
Edited 4 years ago

Hi, I've recently tried an attempt to make an overhead GUI which did nit go down well cause it has no errors and it's not working properly.

local billboardgui = game:GetService("ServerStorage"):WaitForChild("Billboardgui")

game.Players.PlayerAdded:Connect(function(player)

    player.CharacterAdded:Connect(function(character)
 if player.Name == "charlesec" then
local clonedgui = billboardgui:Clone()
clonedgui.TextLabel.Text = "Owner"
clonedgui.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head

     end


end)
0
What is the problem exactly? What doesn't work? bostaffmanbulgaria1 89 — 4y
0
It won't put the gui over my avatars head. charlesec 36 — 4y
0
AlvinBlox made a great tutorial on this. Here's the video: https://www.youtube.com/watch?v=-MsFqGCtn2k kingblaze_1000 359 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

I hope this is what you've been looking for!

local function NewOverheadGui(title, player)
    local BillboardGui = Instance.new("BillboardGui")
    local TextLabel = Instance.new("TextLabel")

    BillboardGui.Parent = workspace:WaitForChild(player.Name).Head
    BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
    BillboardGui.Active = true
    BillboardGui.AlwaysOnTop = true
    BillboardGui.ExtentsOffsetWorldSpace = Vector3.new(0, 5, 0)
    BillboardGui.LightInfluence = 1.000
    BillboardGui.Size = UDim2.new(0, 200, 0, 50)

    TextLabel.Parent = BillboardGui
    TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    TextLabel.BackgroundTransparency = 1.000
    TextLabel.Size = UDim2.new(0, 200, 0, 50)
    TextLabel.Font = Enum.Font.SourceSans
    TextLabel.Text = title
    TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
    TextLabel.TextSize = 14.000

    return BillboardGui
end

game.Players.PlayerAdded:Connect(function(Player)

    if Player.Name == "Owner Name" then
        NewOverheadGui("Owner", Player)
    end

end)
Ad

Answer this question