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: attempt to index field 'Parent' (a nil value)

Previous Thread :: Next Thread 
YouBetterBeleiveIt is not online. YouBetterBeleiveIt
Joined: 15 Aug 2012
Total Posts: 4
03 Sep 2012 06:41 PM
I'm confused, Someone shine some light on this.
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
03 Sep 2012 06:44 PM
Can I see the script?
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
03 Sep 2012 06:45 PM
To find parent is very easy:

All you need to do is have [Object].Parent.Your stuff

Small example (Excuse me if this doesn't work)

function Door (onTouch)
script.Parent.CanCollide= false
wait(5)
script.Parent.CanCollide= false
end
script.Parent.onTouch:connect
end
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
03 Sep 2012 06:46 PM
And you could add fancy debounce features if you want to


db=false
function Door (onTouch)
if db=false then
db=true
script.Parent.CanCollide= false
wait(5)
db=false
script.Parent.CanCollide= false
end
end
Report Abuse
YouBetterBeleiveIt is not online. YouBetterBeleiveIt
Joined: 15 Aug 2012
Total Posts: 4
03 Sep 2012 06:52 PM
Never mind, I was able to fix it. Apparently I was terminating the script before it had a chance to run fully.
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
03 Sep 2012 07:09 PM
Debounce is not fancy. It's been around for a while, and it's not fancy, it's just needed for certain things. And if you're gonna shorten the name which you shouldn't, use DB. Also don't use regular variables! Use local variables! For example:

local Debounce = false

See? And that will create less lag and also when you're done with the variable, you may want to get rid of it.

Debounce = nil

Remember this.
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