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 » Game Design
Home Search
 

Re: Can someone properly DeBounce this?

Previous Thread :: Next Thread 
bluejays1236 is not online. bluejays1236
Joined: 14 Sep 2009
Total Posts: 1068
26 Nov 2014 11:56 AM
Just need it so there's a cool down. Won't work for me unfortunately.

local db=false
script.touch.OnInvoke=function(name)
name.Health=name.MaxHealth
db=true
wait(15)
db=false

end
Report Abuse
ZyronnSorrow is not online. ZyronnSorrow
Joined: 23 Jul 2010
Total Posts: 41
26 Nov 2014 12:11 PM
Wouldn't you need an if statement to check if the debounce is true?

Theoretically I would imagine it to be something like this:

local db=false
script.touch.OnInvoke=function(name)
if db==false then
name.Health=name.MaxHealth
db=true
end
wait(15)
db=false
end

This way, when the brick is touched, the script checks if db is false. If it is false, then the player's health will be restored AND db will be set to true (that way if the brick is touched again before db is set back to false after the 15 second delay, the if statement will not pass because db will be set to true).

I hope that makes sense and good luck!
Report Abuse
bluejays1236 is not online. bluejays1236
Joined: 14 Sep 2009
Total Posts: 1068
26 Nov 2014 12:14 PM
Yes it does and it worked, thank you. :)
Report Abuse
ZyronnSorrow is not online. ZyronnSorrow
Joined: 23 Jul 2010
Total Posts: 41
26 Nov 2014 12:16 PM
Right on! You're welcome! Happy to help!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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