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 » Scripters
Home Search
 

Re: attempt to index field 'Parent' (a nil value)

Previous Thread :: Next Thread 
hoemando is not online. hoemando
Joined: 07 Sep 2013
Total Posts: 110
12 Jun 2017 09:18 AM
Some reason I get this error on my tool.

Output:

07:03:30.091 - Players.Player1.Backpack.Case.Script:3: attempt to index field 'Parent' (a nil value)
07:03:30.093 - Stack Begin
07:03:30.094 - Script 'Players.Player1.Backpack.Case.Script', Line 3
07:03:30.096 - Stack End

Explorer:

>StarterPack
>Case
>Script
>WeldScript
>Welding
>new
>LocalScript
>Owner
>WeldScript
>Welding
>Hand1
>Hand2
>Hand3
>Handle
>Logo
>Wheel1
>Wheel2
>GUI

Script:

while true do
wait(1)
script.Parent.Wheel1.Anchored = false
script.Parent.Wheel2.Anchored = false
script.Parent.Hand1.Anchored = false
script.Parent.Hand2.Anchored = false
script.Parent.Hand3.Anchored = false
script:Destroy()
end

Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
12 Jun 2017 09:48 AM
Do you do this just to mess with us?
Report Abuse
hoemando is not online. hoemando
Joined: 07 Sep 2013
Total Posts: 110
12 Jun 2017 09:50 AM
Nope. I actually need help.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
12 Jun 2017 09:59 AM
Don't delete the script, why would you do that? It invalidates the while loop, making it useless.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
12 Jun 2017 10:04 AM
Though if you really want to delete the script object, I would assume caching the parent would be sufficient. Put this outside of the while loop:

local parent = script.Parent

Then refer to parent instead of script.Parent.

Why would you want to delete the script though? Seems a bit pointless.
Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
12 Jun 2017 10:12 AM
local--[[]]v=script;script={Parent=script.Parent}wait(1)v:Destroy()
while true do
script.Parent.Wheel1.Anchored = false
script.Parent.Wheel2.Anchored = false
script.Parent.Hand1.Anchored = false
script.Parent.Hand2.Anchored = false
script.Parent.Hand3.Anchored = false
wait(1)
end
Report Abuse
hoemando is not online. hoemando
Joined: 07 Sep 2013
Total Posts: 110
12 Jun 2017 10:44 AM
Sorry for the late post. Yeah, I did see the while loop was pointless. I defined parent = script.Parent and it worked. Thanks!
Report Abuse
Sandbaton2134866 is not online. Sandbaton2134866
Joined: 17 Dec 2016
Total Posts: 13
12 Jun 2017 01:23 PM
i dont get what u are trying to say...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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