|
| 09 Jul 2014 04:53 PM |
I've created a plugin that clears out a user's Workspace. I got a message from a user that said it was only running once.
I assume that there's many situations like this, how do I make it so a button can run multiple times? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
|
| 09 Jul 2014 05:01 PM |
@Smiley, there's countless times when a button of any type, even a plugin, might not run more than one time.
I assumed that since this is such a general thing, I could get feedback without having to supply my entire code.
|
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 09 Jul 2014 05:07 PM |
| Maybe the code breaks/errors so the event disconnects? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2014 05:09 PM |
Well, there's not any errors in the code that Output can pick up.
This is the same problem I had with a GUI button before.
|
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
| |
|
fajner1
|
  |
| Joined: 30 Mar 2008 |
| Total Posts: 77 |
|
|
| 09 Jul 2014 05:21 PM |
| Place the event:connect() before any loops. |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2014 05:24 PM |
Instead of posting 100% of the script, I'll just post the function. It's very simplistic, but it was more of an experimental plugin to see how it works.
Button.Click:connect(function() game.Workspace:ClearAllChildren() end) |
|
|
| Report Abuse |
|
|