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

why doesnt the billboardgui get added to the players head?

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

✓ Accepted answer

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)

2 comments

0

thankyou

0

np!

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