|
| 03 Sep 2012 06:41 PM |
| I'm confused, Someone shine some light on this. |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|