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

overhead billboard gui only appears on 1 player?

I've made an overhead billboard gui that works fine but when i tried testing with more than 1 player it switches places to the recent joined player. heres the script

local name = game.ServerStorage.namegui:Clone()


game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(c)
		local hed = c.Head
		name.Parent = c.Head
		hed.namegui.TextButton.Text = p.Name 
		
	end)
end)

2 answers

✓ Accepted answer

Your first variable is saying you have only one copy of the namegui so the way to fix that is to put that between line 5 and 6 like this!



game.Players.PlayerAdded:Connect(function(p)
    p.CharacterAdded:Connect(function(c)
		if c ~= nil and c:FindFirstChild('Head') then -- Just to make sure the character has loaded completely
			local name = game.ServerStorage.namegui:Clone()
	        local hed = c.Head
	        name.Parent = c.Head
	        hed.namegui.TextButton.Text = p.Name 
		end
    end)
end)


What you are doing in your code is that you are cloning it only once, when the script first runs. What you have to do is clone it every single time a player joins.

Here's your new code:

local name = game.ServerStorage.namegui:Clone()

game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(c)
		local head = c.Head
		name.Parent = head
		head.namegui.TextButton.Text = p.Name
	end)
end)

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