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: What am I doing wrong here? [GUI]

Previous Thread :: Next Thread 
Eldoron is not online. Eldoron
Joined: 03 Jan 2010
Total Posts: 19
14 Jun 2015 11:52 AM
Box = script.Parent.Box
Button = script.Parent.OpenAndClose
Open = false

Button.MouseButton1Down:connect(function(click)
if (Open == false) then
Button.Text = "Okay"
Box.Visible = true
Open = true
elseif (Open == true) then
Button.Text = "Open"
Box.Visible = false
Open = false
end
end)

A simple open and close gui. It opens just fine in studio test mode, but when I go to actually play it, it doesn't.
Report Abuse
MerelyOfModels is not online. MerelyOfModels
Joined: 23 Dec 2014
Total Posts: 516
14 Jun 2015 11:57 AM
Your problem is an infinite loop, this should work.

Box = script.Parent.Box
Button = script.Parent.OpenAndClose
Open = false

Button.MouseButton1Down:connect(function(click)
if (Open == false) then
Button.Text = "Okay"
Box.Visible = true
Open = true
elseif (Open == true) then
Button.Text = "Open"
Box.Visible = false
Open = false
end
wait ()
end)
Report Abuse
Eldoron is not online. Eldoron
Joined: 03 Jan 2010
Total Posts: 19
14 Jun 2015 11:58 AM
It still doesn't open.
Report Abuse
MerelyOfModels is not online. MerelyOfModels
Joined: 23 Dec 2014
Total Posts: 516
14 Jun 2015 12:02 PM
ATTEMPT #2

Box = script.Parent.Box
Button = script.Parent.OpenAndClose
Open = false

Button.MouseButton1Down:connect(function(click)
if (Open == false) then
Button.Text = "Okay"
Box.Visible = true
Open = true
elseif (Open == true) then
Button.Text = "Open"
Box.Visible = true
Open = false
end
wait ()
end)
Report Abuse
Eldoron is not online. Eldoron
Joined: 03 Jan 2010
Total Posts: 19
14 Jun 2015 12:07 PM
In studio it doesn't close, and it doesn't open at all when I normally play it.
Report Abuse
Eldoron is not online. Eldoron
Joined: 03 Jan 2010
Total Posts: 19
15 Jun 2015 12:07 AM
bump
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
15 Jun 2015 12:17 AM
local Box = script.Parent:WaitForChild("Box")
local Button = script.Parent:WaitForChild("OpenAndClose")
local Open = false

Button.MouseButton1Down:connect(function(click)
if Open == false then
Button.Text = "Okay"
Box.Visible = true
Open = true
elseif Open == true then
Button.Text = "Open"
Box.Visible = false
Open = false
end
end)

u sicko!
Report Abuse
Eldoron is not online. Eldoron
Joined: 03 Jan 2010
Total Posts: 19
15 Jun 2015 07:43 AM
Ah, thank you! I appreciate it c:
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