generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: 'Parent' (a nil value) Error help

Previous Thread :: Next Thread 
petro180 is not online. 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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
21 Jan 2013 07:53 PM
Which line.
One of the lines has an extra Parent.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
21 Jan 2013 08:05 PM
I'm stupid.
Report Abuse
petro180 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image