--Create the equipped title's billboard gui for a player

function functions.CreateBillboardGui(plr: Player)

	local plrStats = plr.leaderstats
	local plrEquippedTitle = plrStats.EquippedTitle

	local char = plr.Character

	if char and titles:FindFirstChild(plrEquippedTitle.Value) then

		if char.HumanoidRootPart:FindFirstChild("TITLE BILLBOARD GUI") then
			char.HumanoidRootPart["TITLE BILLBOARD GUI"]:Destroy()
		end

		local billboardGui = titles[plrEquippedTitle.Value].BillboardGui:Clone()
		billboardGui.Name = "TITLE BILLBOARD GUI"
		billboardGui.Parent = char.HumanoidRootPart
	end
end



return functions
