#billboardgui not appearing on players head

1 messages · Page 1 of 1 (latest)

wary axle
#

i created this billboard gui to show the players killstreak but its not appearing

#
-----------------// SERVICES \\-------------------------
local Players = game:GetService("Players")
local SSS = game:GetService("ServerScriptService")

---------------// MODULES \\------------------------
local PlayerStats = require(SSS.Game.PlayerStats)

for _, model in ipairs(workspace:GetDescendants()) do
    if model:IsA("Model") then
        local humanoid = model:FindFirstChildOfClass("Humanoid")
        if humanoid then
            humanoid.Died:Connect(function()
                local creatorTag = model:FindFirstChild("creator")
                if not creatorTag or not creatorTag.Value then
                    warn("Tags not found")
                    return
                end

                local killerPlayer = Players:GetPlayerByUserId(creatorTag.Value)
                if not killerPlayer then
                    warn("Killer player not found")
                    return
                end
                
                local plrStats = PlayerStats.Get(killerPlayer)
                PlayerStats:ApplyUpgrade(killerPlayer, "Killstreak", 1)
                local currentKillstreak = PlayerStats:GetStatData(killerPlayer, "Killstreak")
                
                local newBillboard = Instance.new("BillboardGui")
                newBillboard.ClipsDescendants = true
                newBillboard.Parent = killerPlayer.Character.PrimaryPart
                newBillboard.Size = UDim2.new(1, 0, 1, 0)
                newBillboard.AlwaysOnTop = true
                newBillboard.Enabled = true