Overhead NameTag disappearing when dying

Im trying to achieve just a simple Creator tag that goes over my head in my simulator game, the issue is when I reset the nametag just disappears into oblivion, ive tried asking other scripters and they said I would need another line of script to keep the nametag there for when I reset but I honestly cannot figure it out, I just need some assistance with creating this because im at my breaking point

local players = game:GetService("Players")

local rainbow = false

players.PlayerAdded:Connect(function(player)
	if player.Name == "JackEatsFrootLoops" then  
		wait(5)
		local gui = script:WaitForChild("BillboardGui")
		
		local text = gui:WaitForChild("TextLabel")
		
		if rainbow == true then
			text:WaitForChild("ColorChange").Disabled = false
		end
		
		text.Font = Enum.Font.Oswald  
		text.Text = "CREATOR" 
		text.TextColor3 = Color3.fromRGB(0, 0, 128)
		gui.Parent = player.Character.Head
	end
end)

https://gyazo.com/70a217c373956f8d2b35c3d8d68dc0f0

All you need to do is instead of putting it in a player added function, put it in a characterAdded function.

When the player respawns you’d want them to respawn with the Billboard GUI. Currently, there is no instruction on what to do with a Billboard GUI when a player respawns. To fix this, we’ll add some code to specifically instruct that when a player’s character is added into the game at any point, give them the Billboard Gui.

How do I go about fixing this?

Example Code:

local players = game:GetService("Players")

local rainbow = false

players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if player.Name == "JackEatsFrootLoops" then  
            task.wait(5)
            local gui = script:WaitForChild("BillboardGui")
            
            local text = gui:WaitForChild("TextLabel")
            
            if rainbow == true then
                text:WaitForChild("ColorChange").Disabled = false
            end
            
            text.Font = Enum.Font.Oswald  
            text.Text = "CREATOR" 
            text.TextColor3 = Color3.fromRGB(0, 0, 128)
            gui.Parent = character.Head
        end
    end)
end)

try this

local players = game:GetService("Players")
local rainbow = false

local NameTag = script:WaitForChild("BillboardGui")
local text = NameTag:WaitForChild("TextLabel")

text:WaitForChild("ColorChange").Disabled = not rainbow
text.Font = Enum.Font.Oswald  
text.Text = "CREATOR" 
text.TextColor3 = Color3.fromRGB(0, 0, 128)

NameTag.Enabled = false
NameTag.Parent = workspace        

players.PlayerAdded:Connect(function(plr)
    if player.Name == "JackEatsFrootLoops" then
        plr.CharacterAdded:Connect(function(char)
            NameTag.Adornee = char:WaitForChild("Head")
            NameTag.Enabled = true
        end)
    end
end)

Storing the billboard in serverstorage under a folder named Tags and waiting for players appreance to load before cloning billboard to player should work well.

local players = game:GetService("Players")

local rainbow = false

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.Name == "JackEatsFrootLoops" then
			player.CharacterAppearanceLoaded:Wait()
			local gui = game:GetService("ServerStorage"):WaitForChild("Tags"):WaitForChild("BillboardGui")
			local ServerTagClone = gui:Clone()
			local text = ServerTagClone:WaitForChild("TextLabel")

			if rainbow == true then
				text:WaitForChild("ColorChange").Disabled = false
			end

			text.Font = Enum.Font.Oswald  
			text.Text = "CREATOR" 
			text.TextColor3 = Color3.fromRGB(0, 0, 128)
			ServerTagClone.Parent = character:WaitForChild("Head")
		end
	end)
end)

make the check for the playername before you make a connection for the CharacterAdded

How So? Cause everyone elses suggestion in the code either makes the code stop working completely or it just continues to do the same thing?

Still doesnt reappear after death

Makes the script stop working for its entirety for some reason

It still doesnt want to reappear when I reset, so I dont know at this point

You need to clone the gui and then parent it to your character. In short, you’re basically putting it on your character once and then it’s non existent, which is why it doesn’t reappear.

Im sorry but I have no idea how to do that, can you guide me like through it?

local players = game:GetService("Players")
local gui = script:WaitForChild("BillboardGui")

local rainbow = false

players.PlayerAdded:Connect(function(player)
	if player.Name == "JackEatsFrootLoops" then  
		player.CharacterAdded:Connect(function(character)
			wait(5)
			local guiClone = gui:Clone()
		
			local text = guiClone:FindFirstChild("TextLabel")
		
			if rainbow == true then
				text:FindFirstChild("ColorChange").Disabled = false
			end
		
			text.Font = Enum.Font.Oswald  
			text.Text = "CREATOR" 
			text.TextColor3 = Color3.fromRGB(0, 0, 128)
			guiClone.Parent = character:WaitForChild("Head")
		end)
	end
end)
2 Likes

You are an actually amazing person.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.