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

Why is this head-creating script not working right?

So this script is supposed to change the color of the new head part to your current head's color. However, it is not working, and I have no idea why, as output was not of much use. Can someone please help me?

Here's the script:

function spn(NewP) 

	wait()
	local mesh = NewP.Character.Head:findFirstChild("Mesh")
	local Part = Instance.new("Part") 
	Part.BrickColor = NewP.Character("Body Colors").HeadColor ----The script worked fine until I added this line

	-----rest of code
end

4 comments

0

Use brackets rather than parentheses (use [] instead of () to hold Body Colors).

0

Still doesn't work, but output gave me this: "Body Colors is not a valid member of Model"

0

Trying using a repeat wait() until NewP.Character:FindFirstChild("Body Colors"), chances are, Body Colors may not be spawning quick enough.

0

I fixed it. Thanks for the help!

1 answer

im not sure but this could work:

Part.BrickColor = BrickColor.new(NewP.Character("Body Colors").HeadColor)

1 comment

0

That will not work.

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