| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 20 Feb 2014 11:00 PM |
It helps check if the script is in a certain place.
|
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 20 Feb 2014 11:11 PM |
On Roblox we use a "debounce"* when we want to have a delay between something occurring. Most commonly, this something happening is an event.
While that may sound a bit confusing, here's an example of a debounce being used for a Touched event and will only allow the event to fire once every 5 seconds,
local deb = false --deb is short for "debounce"
script.Parent.Touched:connect(function(hit) --our Touched event if not deb then --if deb is false then proceed... deb = true --set our debounce to true print("Part was touched") wait(5) --we need to wait 5 seconds before our Touched event can be triggered again deb = false --set our debounce to false, allowing the first (if) statement to proceed end end)
for further reference, check out this wiki page: http://wiki.roblox.com/index.php?title=Debounce |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 20 Feb 2014 11:13 PM |
"Most commonly, this something happening is an event."
Should be "this something occurring is an event." I forgot that I changed my wording :P |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2014 11:13 PM |
| Okay, thanks for the help! |
|
|
| Report Abuse |
|
|
iYoshiFox
|
  |
| Joined: 14 Apr 2012 |
| Total Posts: 1058 |
|
|
| 21 Feb 2014 02:08 AM |
| I just use it to debug the touched event :P |
|
|
| Report Abuse |
|
|