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

why doesnt the billboardgui get added to the players head?

Asked by 6 years ago
print("start")
local billbaord = game:GetService("ReplicatedStorage"):WaitForChild("BillbaordGui")
game.Players.PlayerAdded:connect(function(player)
    wait(1)
    print("player added")
    local clonedBillbaord = billbaord:Clone()
    print ("billbaord cloned")
    clonedBillbaord.Parent = game.Workspace[player.Name].Head
    print("added to head")
end)
print ("end")

this script is in server script server and the billbaord is in replicated storage when you press play you get no errors yet the gui doesnt go into the players head

am i missing something

1 answer

Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
6 years ago

Sometimes this can happen because the player hasn't loaded yet. Here's a better method:

local BillboardGui = game:GetService('ReplicatedStorage'):WaitForChild('BillboardGui') --You may have also made a spelling mistake here.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char) --Fires everytime the player respawns
        char:WaitForChild('Head')
        local clonedBillBoard = BillboardGui:Clone()
        clonedBillBoard.Parent = char.Head
    end)
end)
0
thankyou EpicAshtonTheBoy 33 — 6y
0
np! Mayk728 855 — 6y
Ad

Answer this question