|
| 24 Jul 2013 04:52 PM |
while true do if script.Parent.Position.y < 483 then -- Is Height > 482 script.Parent.Parent.Parent."Right Arm".Reflectance = 1 script.Parent.Parent.Parent."Left Arm".Reflectance = 1 script.Parent.Parent.Parent."Torso".Reflectance = 1 script.Parent.Parent.Parent."Right Leg".Reflectance = 1 script.Parent.Parent.Parent["Left Leg".Reflectance = 1 script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2 wait(10) end
Basically, this script is designed to make the player's bodyparts reflective when they get to a certain altitude in-game. However, on line 3, it says it is expecting a name near the " or something. Halp pl0x? |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 04:53 PM |
script.Parent.Parent.Parent["Right Arm"].Reflectance = 1
Change that part on every line |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 04:54 PM |
do script.Parent.Parent.Parent:findFirstChild("BODY PART NAME").Reflectance = 1 :P |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 04:54 PM |
| No no, what I have is right. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 04:55 PM |
| Same thing happened, only it now expects the "name" near the "[" |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 04:57 PM |
| Speghetti, now it is trying to tell me I am trying to index a function value. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 05:03 PM |
| This is really confusing, I don't know what to do now. :L |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 25 Jul 2013 04:16 AM |
What is "script.Parent.Position.y"?
This might work.
while true do if script.Parent.Position.Y.Offset < 483 then script.Parent.Parent.Parent["Right Arm"].Reflectance = 1 script.Parent.Parent.Parent["Left Arm"].Reflectance = 1 script.Parent.Parent.Parent["Torso"].Reflectance = 1 script.Parent.Parent.Parent["Right Leg"].Reflectance = 1 script.Parent.Parent.Parent["Left Leg"].Reflectance = 1 script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2 wait(10) end |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:19 AM |
That script is attempting to index a field Y which is a nil value, apparently.
This is the script I've got. while true do if script.Parent.Position.y < 483 then -- Is Height > 482 script.Parent.Parent.Parent.findFirstChild["Right Arm"].Reflectance = 1 script.Parent.Parent.Parent.findFirstChild["Left Arm"].Reflectance = 1 script.Parent.Parent.Parent.findFirstChild["Torso"].Reflectance = 1 script.Parent.Parent.Parent.findFirstChild["Right Leg"].Reflectance = 1 script.Parent.Parent.Parent.findFirstChild["Left Leg"].Reflectance = 1 script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2 wait(10) end end
still doesn't work |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:19 AM |
| Like I asked, what is "script.Parent.Position.y"? |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:22 AM |
| Me trying to get the Y coordinate. Hey, I thought it'd work. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:27 AM |
dood what the hell is it getting the coordinates of?
i can see what you are trying to do... |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:29 AM |
| Trying to get the co ordinates of a Handle in a tool. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:32 AM |
| Take out ".findFirstChild" everywhere. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:33 AM |
| Well that returns me back to the original code |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:34 AM |
Try to cap the Y but i mean mine should work, i am new(ish) with this stuff so...
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:34 AM |
| No, the square brackets were what was missing in the original code. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:35 AM |
| I've tried it with the brackets, it was still broken |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:36 AM |
| Post the code so I can see your mistake. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:36 AM |
:o Ya, sorry idk anything about dealing with tools. |
|
|
| Report Abuse |
|
|
| |
|
ssadak
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 30 |
|
|
| 25 Jul 2013 04:40 AM |
I really need help scripting its hard
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 04:40 AM |
Hmm. One problem is that the health reduction does not loop. while true do if script.Parent.Position.y < 483 then -- Is Height > 482 script.Parent.Parent.Parent["Right Arm"].Reflectance = 1 script.Parent.Parent.Parent["Left Arm"].Reflectance = 1 script.Parent.Parent.Parent["Torso"].Reflectance = 1 script.Parent.Parent.Parent["Right Leg"].Reflectance = 1 script.Parent.Parent.Parent["Left Leg"].Reflectance = 1 script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 10 wait(3) end end
This is the code, there is no error in the output, but it won't keep looping. |
|
|
| Report Abuse |
|
|