|
| 03 Jul 2013 03:56 PM |
I want the tool to morph to the color of the wearer's arm, however the console is saying this: Workspace.Player1.Fruit's Justice Claw.Script:7: bad argument #1 to 'new' (Color3 expected, got userdata)
The script is:
function onEquipped() for _, v in pairs(script.Parent:GetChildren()) do ra = script.Parent.Parent:FindFirstChild("Right Arm") if ra then rac = ra.BrickColor print(rac) v.BrickColor = BrickColor.new(rac) end end end
script.Parent.Equipped:connect(onEquipped)
Now, being the novice I am, I have no idea what's wrong, and help would be much appreciated. |
|
|
| Report Abuse |
|
|
kinglime
|
  |
| Joined: 27 Jun 2008 |
| Total Posts: 2751 |
|
|
| 03 Jul 2013 04:00 PM |
| ra = script.Parent.Parent:FindFirstChild(["Right Arm"]) |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 04:03 PM |
kinglime, First of all, that isn't working. Second of all, an explanation of what's actually wrong would help. |
|
|
| Report Abuse |
|
|
kinglime
|
  |
| Joined: 27 Jun 2008 |
| Total Posts: 2751 |
|
|
| 03 Jul 2013 04:05 PM |
This is the only thing I see wrong with it... When using something with a space, example Right Arm,Left Arm, Right Leg, Left Leg you must put it between [" "] |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 04:14 PM |
Hm. Well, when I use what you said, the error it returned was this if it helps at all: 17:14:05.984 - Players.Player1.Backpack.Fruit's Justice Claw.Script:3: unexpected symbol near ']' |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 04:25 PM |
function onEquipped() for _, v in pairs(script.Parent:GetChildren()) do ra = script.Parent.Parent:FindFirstChild("Right Arm") if ra then rac = ra.BrickColor print(rac) v.BrickColor = rac end end end
script.Parent.Equipped:connect(onEquipped) |
|
|
| Report Abuse |
|
|