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: Debounce... JUST DONT WORKS!

Previous Thread :: Next Thread 
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
24 Aug 2013 11:49 PM
brick = script.Parent
Debounce = false
name = brick.Parent
unlocked = "Unlocked!"

brick.Touched:connect(function()
if Debounce == false then
Debounce = true
end
wait(2)
brick.Color = BrickColor.new(26).Color
brick.CanCollide = true
for i = 180, 1, -1 do
name.Name = ("Locked! Wait".. i.. " seconds to be unlocked!")
wait(1)
end
brick.Color = BrickColor.new(208).Color
name.Name = unlocked
brick.CanCollide = false
Debounce = false
end)


Debounce does nothing in this case!
I've tried with 'debounce' as well!

== DOOM BUCKET BEATS EVERY ITEM IN ROBLOX==
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
24 Aug 2013 11:53 PM
Is it the debounce that doesn't work or the script?
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
24 Aug 2013 11:54 PM
The debounce.
The script works fine :)

== DOOM BUCKET BEATS EVERY ITEM IN ROBLOX==
Report Abuse
reptoslicerguy is not online. reptoslicerguy
Joined: 01 Jan 2010
Total Posts: 2098
24 Aug 2013 11:57 PM
maybe i read it wrong but i say a debounce in a if statment then you ending the if statment so no matter what the dbounce is it would still run the whole script
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
25 Aug 2013 12:00 AM
You used db wrong.

brick = script.Parent
Debounce = false
name = brick.Parent
unlocked = "Unlocked!"

brick.Touched:connect(function()
if not Debounce then
Debounce = true
wait(2)
brick.Color = BrickColor.new(26).Color
brick.CanCollide = true
for i = 180, 1, -1 do
name.Name = ("Locked! Wait".. i.. " seconds to be unlocked!")
wait(1)
end
brick.Color = BrickColor.new(208).Color
name.Name = unlocked
brick.CanCollide = false
Debounce = false
end
end)
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
25 Aug 2013 12:01 AM
Notice, I didn't end the first 'if' statement.
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
25 Aug 2013 12:05 AM
@shon
At first it does fine, but if I touch it again it goes crazy!
qq

== DOOM BUCKET BEATS EVERY ITEM IN ROBLOX==
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
25 Aug 2013 12:13 AM
Here,

brick = script.Parent
Debounce = false
name = brick.Parent
unlocked = "Unlocked!"

brick.Touched:connect(function()
if Debounce == true then return end
Debounce = true
end
wait(2)
brick.Color = BrickColor.new(26).Color
brick.CanCollide = true
for i = 180, 1, -1 do
name.Name = ("Locked! Wait".. i.. " seconds to be unlocked!")
wait(1)
end
brick.Color = BrickColor.new(208).Color
name.Name = unlocked
brick.CanCollide = false
Debounce = false
end)
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
25 Aug 2013 12:16 AM
no wait,

brick = script.Parent
Debounce = false
name = brick.Parent
unlocked = "Unlocked!"

brick.Touched:connect(function()
if Debounce == true then return end
Debounce = true
wait(2)
brick.Color = BrickColor.new(26).Color
brick.CanCollide = true
for i = 180, 1, -1 do
name.Name = ("Locked! Wait".. i.. " seconds to be unlocked!")
wait(1)
end
brick.Color = BrickColor.new(208).Color
name.Name = unlocked
brick.CanCollide = false
Debounce = false
end)
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
25 Aug 2013 12:17 AM
I fixed it for you, and, yet, nothing.
omg

== DOOM BUCKET BEATS EVERY ITEM IN ROBLOX==
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