Whenever I touch the part, it says BodyColors is not a valid member of (my username).
Also if possible, can someone help me scan the player’s entire body color, not just the torso? It’s important.
Whenever I touch the part, it says BodyColors is not a valid member of (my username).
Also if possible, can someone help me scan the player’s entire body color, not just the torso? It’s important.
It said that bc it thinks the BodyColors your refering as is a part in side the player.
So how do I inform it that I mean the property, not a part?
The player is a model and no model have that property.
Are you saying no player has a property called “BodyColors”? If so, thats false.
I’m not really known for models but if im wrong then don’t use (“FindFirstChild”)
Even though it’s not a part, it’s still a child if I’m correct. Therefore I can still use findfirstchild.
Can you screen shot it? So i can know.
Theres a space between the name.
Write (“Body Colors”) instead. Because theres no part that named “BodyColors”
local part = script.Parent
part.Touched:Connect(function(Object)
if not Object.Parent:FindFirstChild("Humanoid") then return end
local SkinColors = Object.Parent["Body Colors"]
if SkinColors.TorsoColor == BrickColor.new("Dark Brown") then
Object.Parent.Humanoid.Health = 0
end
end)
FindFirstchild(“Body Colors”). You should write that instead of that but if you still wanna do that then write
if plrpart.Parent["Body Colors"]
I have that down already, but I need to reference it later in the script, How do I reference a 2 worded object?
I guess another problem arose, this is my new script:
error is the same as the first error.
then use plrpart.Parent[“Body Colors”] then.
No error this time. Looking good so far.
And i would suggest write this instead:
if skintones.TorsoColor == "Dark Brown"
Because you already defind the skintones if you write it like what you write then it would be :
if plrpart.Parent.plrpart.Parent:FindFirstChild("Body Colors").TorsoColor == "Dark Brown"