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 » Scripters
Home Search
 

Re: Trouble with adding to value?

Previous Thread :: Next Thread 
Tokimonu is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
26 Feb 2015 09:51 PM
local part = script.Parent
local screen = part.Parent:FindFirstChild("screen")

debounce = false

part.Touched:connect(function(hit)
debounce = true
local num = screen.num
num.Value = num.Value + 1
end)

part.TouchEnded:connect(function(hit)
debounce = true
local num = screen.num
num.Value = num.Value - 1
end)

debounce = false

Basically, when the player steps on, it adds +1 to the value, then when they step off, it subtracts -1 from the value, and when you go anywhere near it the value goes to -10, and then subtracts slowly?

I tried adding debounce but it wouldn't work.
Report Abuse
Tokimonu is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
26 Feb 2015 09:55 PM
+bump
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
26 Feb 2015 09:56 PM
You didn't add the debounce correctly.
Report Abuse
Tokimonu is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
26 Feb 2015 09:58 PM
How do you do it correctly?
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
26 Feb 2015 09:59 PM
http://wiki.roblox.com/index.php?title=Debounce
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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