Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this head-creating script not working right?

Asked by 9 years ago

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
0
Use brackets rather than parentheses (use [] instead of () to hold Body Colors). M39a9am3R 3210 — 9y
0
Still doesn't work, but output gave me this: "Body Colors is not a valid member of Model" CoolJohnnyboy 121 — 9y
0
Trying using a repeat wait() until NewP.Character:FindFirstChild("Body Colors"), chances are, Body Colors may not be spawning quick enough. M39a9am3R 3210 — 9y
0
I fixed it. Thanks for the help! CoolJohnnyboy 121 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

im not sure but this could work:

Part.BrickColor = BrickColor.new(NewP.Character("Body Colors").HeadColor)
0
That will not work. Redbullusa 1580 — 9y
Ad

Answer this question