|
| 05 May 2013 04:37 PM |
Ok, if I want my script to wait until till someone clicks on 1 of 4 gui buttons.....how would I do it?
repeat wait () until .....Click A, B, C, or D? if ... --if they click button A? if ... B if ... C if ... D end
|
|
|
| Report Abuse |
|
|
|
| 05 May 2013 04:42 PM |
buttonA.MouseButton1Click:connect(function() --blah end) buttonB.MouseButton1Click:connect(function() --blah end)
Like that? If not, you can try adding a value in those buttons and when they're clicked, the values are changed which the script can check for. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 04:47 PM |
So it'd be:?
repeat wait() until buttonA.MouseButton1Click:connect(function() --blah end) buttonB.MouseButton1Click:connect(function() --blah end) buttonC.MouseButton1Click:connect(function() --blah end) buttonD.MouseButton1Click:connect(function() --blah end) end |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 04:59 PM |
Prolly won't work.
A,B,C,D = false,false,false,false buttonA.MouseButton1Click:connect(function() A= true end) buttonB.MouseButton1Click:connect(function() B= true end) buttonC.MouseButton1Click:connect(function() C=true end) buttonD.MouseButton1Click:connect(function() D=true end) repeat wait() until A or B or C or D
|
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:01 PM |
| What if I'm wanting each button to perform a different task? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:02 PM |
would it be that....then after;
if a == true then --BLAH end
b
c
d
|
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:05 PM |
A,B,C,D = false,false,false,false buttonA.MouseButton1Click:connect(function() A= true end) buttonB.MouseButton1Click:connect(function() B= true end) buttonC.MouseButton1Click:connect(function() C=true end) buttonD.MouseButton1Click:connect(function() D=true end) repeat wait() until A or B or C or D if A then --stuff elseif B then elseif C then elseif D then end |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:09 PM |
| Do they need to be elseif's? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:13 PM |
Nevermind, even if they didn't, they would have to be in my case...
Thanks for the help :D
...AGAIN. xD |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2013 05:31 PM |
| Ok, everything is working correctly except for 1 little detail....even if I click.....nothing happens. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 05:39 PM |
| I can post the script if needed? |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:00 PM |
This worked for me.... prints once though.
A,B,C,D = false,false,false,false script.Parent.A.MouseButton1Click:connect(function() A= true end) script.Parent.B.MouseButton1Click:connect(function() B= true end) script.Parent.C.MouseButton1Click:connect(function() C=true end) script.Parent.D.MouseButton1Click:connect(function() D=true end) repeat wait() until A or B or C or D if A then print("a") elseif B then print("b") elseif C then print("c") elseif D then print('d') end |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2013 06:07 PM |
^^^Ignore^^^
My script uses the EXACT same thing, but with other things where the --stuff is....everything works until I have to click....and at that point, even if I click, nothing happens... |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:08 PM |
| I would post the script.....but Roblox won't let me. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:12 PM |
| It won't let you? what? o-o |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:13 PM |
It says it goes against the their regulation rules.. o.o FOR NO REASON.. :T |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2013 06:18 PM |
No, nothing. It works fine, no errors in the output, and when I get to that part, still nothing. |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:20 PM |
Maybe it's the name of the variables of part of your code that won't let you post it?
I can't really tell what's going on if I don't know what you're trying to do :\ |
|
|
| Report Abuse |
|
|
|
| 05 May 2013 06:21 PM |
Maybe I can message it to you? o.o
|
|
|
| Report Abuse |
|
|
| |
|