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

What does ManChild266 is not a vaid part of workspace?

local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
	if player.Name == "ManChild266" then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace[player.Name].Head
		clonedgui.TextLabel.Text = "Founder"
		clonedgui.TextColor3 = Color3.fromRGB(255,255,0)
	end
	if player.Name == "cwood2006" then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace[player.Name].Head
		clonedgui.TextLabel.Text = "Founder"
		clonedgui.TextColor3 = Color3.fromRGB(255,255,0)
	end	
	if player.Name == "lickface980" then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace[player.Name].Head
		clonedgui.TextLabel.Text = "Founder"
		clonedgui.TextColor3 = Color3.fromRGB(255,255,0)
	end
		if player.Name == "xXDeathSpectreXx" then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace[player.Name].Head
		clonedgui.TextLabel.Text = "Founder"
		clonedgui.TextColor3 = Color3.fromRGB(255,255,0)
	end	
		if player.Name == "MomentousSithlord99" then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace[player.Name].Head
		clonedgui.TextLabel.Text = "Founder"
		clonedgui.TextColor3 = Color3.fromRGB(255,255,0)
	end
end)

1 comment

0

It says ManChild266 is not a vaid part of workspace

2 answers

It says that because the player's character hasn't loaded yet. You can use WaitForChild.

clonedgui.Parent = workspace:WaitForChild(player.Name).Head

Hope this helps!

I noticed a few errors in the code so I shortened it to make it easier for you:

local billboard = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
local founders = {"ManChild266","cwood2006","lickface980","xXDeathSpectreXx","MomentousSithlord99"}

game.Players.PlayerAdded:Connect(function(plr)
	for a, newPlr in pairs(founders) do
		if plr.Name == newPlr then
			repeat wait() until plr.Character
			local bg = billboard:Clone()
			bg.Parent = plr.Character.Head
			bg.TextLabel.Text = "Founder"
			bg.TextLabel.TextColor = Color3.fromRGB(255,255,0)
		end
	end
end)

Here were the errors I caught so you have a future reference: When you attempted to change the text color of the label, you accidentally tried to set the text color to the gui itself which isn't a valid property. Additionally, TextColor3 is not a property of a TextLabel, it should only be TextColor without the "3". Finally, the game "attempted to index a nil value" because the find character function didn't work.

2 comments

0

It didn't all fit the page so remember to paste from "View Source"

0

Remember to change the title to solved and accept and answer!

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