YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:44 PM |
And what it's useful for?
If you want you could just sent me to the wiki but I think you guys could explain better, but do as you wish. |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:44 PM |
| I meant debounce sorry ipad auto corrects ;/ |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 02:49 PM |
It prevents code from running twice at the same time.
debounce = false if debounce = false then debounce = true --stuff debounce = false end |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:50 PM |
| If I kept it at true would it keep it true for only one pLayer or for everyone in the server? |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 02:51 PM |
| The value is only within that script. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 02:56 PM |
| To answer your last question, it would affect everyone if you are using a regular script |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:57 PM |
Thanks so much for the help. Also I just realized I already knew this but didn't know it was called debounce ... But you did help me by telling me who it affected thanks ! |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:57 PM |
| So Mario if I wanted it to affect only one player I would add it to local script? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 11 Feb 2014 03:04 PM |
debounce = true script.Parent.Touched:connect(function() print'We were touched' if debounce == true then print'Debounce is true...making it false' debounce = false print'debounce is now false' else -- this is when debounce is false print'debounce is false' wait(2) debounce = true end end)
--Paste this into a script and put the script into a part then walk over the part. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 11 Feb 2014 03:05 PM |
Read this.
http://wiki.roblox.com/index.php/Debounce
If you really want to learn, you'll read it all. |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
| |
|
|
| 11 Feb 2014 03:10 PM |
One script stays in one script
-- One script -- Stuff = true print(Stuff) >true -- Other script -- print(Stuff) >nil OR >error: string expected |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 03:23 PM |
| Thanks i already got it you guys dont have to keep posting thanks. |
|
|
| Report Abuse |
|
|