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

Requesting assistance on this part color script?

Asked by 4 years ago
Edited 4 years ago

Once again thank you for reading, I require assistance on this simple but not so seasoned script i made

wait(1)

local Handle = script.Parent
local torso = Handle.Parent.Parent:WaitForChild("UpperTorso")

Handle.BrickColor = torso.BodyColor

Technically, a person would have a certain torso color, then some accessories would be colored to match the torso bodycolor. This is placed in a script inside the accessory. The code does not work.

Thank you.

0
Are you looking for when the tool is clicked, it will change color? Noxcitrus 2 — 4y

1 answer

Log in to vote
0
Answered by
7zjh 146
4 years ago
Edited 4 years ago

BodyColor is not a real property under part. Just change it to:

wait(1)

local Handle = script.Parent
local torso = Handle.Parent.Parent:WaitForChild("UpperTorso")

Handle.BrickColor = torso.BrickColor

If you wanted to make the script work when the player equips the tool, do:

script.Parent.Parent.Equipped:Connect(function()
wait(1)

local Handle = script.Parent
local torso = Handle.Parent.Parent:WaitForChild("UpperTorso")

Handle.BrickColor = torso.BrickColor
end)

I was just assuming you were making a tool so yeah.

0
i was actually not making a tool, but thanks for the new insight! Mrs_Blanche 2 — 4y
0
It said handle so I just assumed it was a tool lmao 7zjh 146 — 4y
Ad

Answer this question