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: Debounse

Previous Thread :: Next Thread 
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
20 Feb 2014 10:59 PM
What is Debounse?
Report Abuse
KEVEKEV77 is not online. 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 is not online. 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 is not online. 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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
20 Feb 2014 11:13 PM
Okay, thanks for the help!
Report Abuse
iYoshiFox is not online. 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
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