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: Repeat wait until?

Previous Thread :: Next Thread 
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 05:01 PM
What if I'm wanting each button to perform a different task?
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 05:02 PM
would it be that....then after;

if a == true then
--BLAH
end

b

c

d
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 05:09 PM
Do they need to be elseif's?
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 05:14 PM
np c:
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 05:31 PM
Ok, everything is working correctly except for 1 little detail....even if I click.....nothing happens.
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 05:39 PM
I can post the script if needed?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 06:01 PM
Bumpy~
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 06:08 PM
I would post the script.....but Roblox won't let me.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 06:12 PM
It won't let you? what? o-o
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 06:13 PM
It says it goes against the their regulation rules.. o.o
FOR NO REASON.. :T
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 06:14 PM
So no output or anything?
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
05 May 2013 06:21 PM
Maybe I can message it to you? o.o
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 06:24 PM
Please try xP
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