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: How to add cooldown after button press

Previous Thread :: Next Thread 
XtReMeInSaNiTy is not online. XtReMeInSaNiTy
Joined: 22 Aug 2010
Total Posts: 212
12 May 2014 09:49 PM
When you spam the different style hair buttons it will spam hair hair all over the ground because it can't keep up. Can anyone help me?
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
12 May 2014 10:11 PM
lol

add a wait''; --interval (3);
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
12 May 2014 10:18 PM
[ Content Deleted ]
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
12 May 2014 10:22 PM
Nah, debounce,

cooldown = --Put amount of seconds for cooldown to last.

db = false
script.Parent.MouseButton1Down:connect(function()
if db == false then db = true end
--your code
end end)
wait(cooldown)
db = false
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
12 May 2014 10:32 PM
cooldown = --Put amount of seconds for cooldown to last.

db = false

script.Parent.MouseButton1Down:connect(function()

if db == false then db = true end
--your code
wait(cooldown)
db = false
end

end)

--you had the wait at rong spot
Report Abuse
XtReMeInSaNiTy is not online. XtReMeInSaNiTy
Joined: 22 Aug 2010
Total Posts: 212
13 May 2014 02:03 PM
there an error with your debounce :l anyone else?
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
13 May 2014 06:05 PM
local wait_time=3;
local aa=script.Parent;
give=function()
db=false;
if(db==false)then db=true;end wait(wait_time)end;
aa.MouseButton1Down:connect(give);
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 May 2014 11:29 PM
^Dat C++ usage showin incho work.
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
22 May 2014 04:31 PM
ok
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
22 May 2014 07:22 PM
cooldown = --Put amount of seconds for cooldown to last.

db = false

script.Parent.MouseButton1Down:connect(function()
if db == false then
db = true
--your code
wait(cooldown)
db = false
end
end)

--leedle, I had an end at the rong spot
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