petro180
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 354 |
|
|
| 21 Jan 2013 07:50 PM |
I keep getting a output message saying "tried to access 'Parent' (a nil value)"
script.Parent.use.MouseButton1Click:connect(function() if script.Parent.Parent.Image == "http://www.roblox.com/asset/?id=104305362" then script.Parent.Parent.Parent.Parent.F.Water.Value.Value = 480 script.Parent:Remove() script.Parent.Parent.Parent.Items.Value = script.Parent.Parent.Parent.Items.Value - 1 elseif script.Parent.Parent.Image == "http://www.roblox.com/asset/?id=104305336" then script.Parent.Parent.Parent.Parent.F.Food.Value.Value = 480 script.Parent:Remove() script.Parent.Parent.Parent.Items.Value = script.Parent.Parent.Parent.Items.Value - 1 elseif script.Parent.Parent.Image == "http://www.roblox.com/asset/?id=104309102" then script.Parent.Parent.Parent.Parent.Parent.Parent.Player.Humanoid.Health = 100 script.Parent:Remove() script.Parent.Parent.Parent.Items.Value = script.Parent.Parent.Parent.Items.Value - 1 end end) |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2013 07:53 PM |
Which line. One of the lines has an extra Parent. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2013 07:56 PM |
No, it doesn't. The person above is wrong.
script.Parent:Remove()
You delete the script's parent in that line. Though you use 'script.Parent' repeatedly afterward. That doesn't make sense. |
|
|
| Report Abuse |
|
|
| |
|
petro180
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 354 |
|
|
| 21 Jan 2013 08:14 PM |
| Dude, thanks. You saved me another hour of looking. I'm just tired so I forgot about the little things... |
|
|
| Report Abuse |
|
|