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: GUI Help!

Previous Thread :: Next Thread 
Colbie988 is not online. Colbie988
Joined: 03 Mar 2012
Total Posts: 885
13 Dec 2012 09:36 PM
Does anyone know the script to make a GUI Button change it's text and it's function after it's been clicked? I wanna make an open/close button, that's the only thing I'm confused about. S.O.S HELP !!!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
13 Dec 2012 09:40 PM
Use an if statement to find the button's current text. Then change the text after each click.

For hippies: http://www.roblox.com/Peace-Shirt-TRANSPARENT-item?id=99429853
Report Abuse
caw454 is not online. caw454
Joined: 14 Jul 2009
Total Posts: 344
13 Dec 2012 09:42 PM
Wait, so like, when you touch a door, the Gui pops up? And then you click 'open' and the door opens, and then you click 'close' and it closes? Or what?

~caw~
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 02:42 AM
I know what you mean. Very simple script to do this

num = 1
text = {"Open","Close"}
gui = script.Parent.Parent.Frame -- thing you want to make visible/invisible


script.Parent.MouseButton1Click:connect(function()
gui.Visible = not gui.Visible
num = num + 1
if num > 2 then
num = 1
end
script.Parent.Text = text[num]
end)
Report Abuse
Colbie988 is not online. Colbie988
Joined: 03 Mar 2012
Total Posts: 885
14 Dec 2012 04:16 AM
Oh thanks Jelly! This works perfectly! :D
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 04:22 AM
You're welcome :)
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
14 Dec 2012 07:34 AM
Jelly, a little inefficient, but nice.

For hippies: http://www.roblox.com/Peace-Shirt-TRANSPARENT-item?id=99429853
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 08:01 AM
I wrote that last night (british) and I was tired so efficiency wasn't my top priority :P
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
14 Dec 2012 08:32 AM
Ceaseless, don't post that siggy in Scripters. Sorcus doesn't like that.

- thedestroyer115
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
14 Dec 2012 04:51 PM
XD, nah, Sorcus doesn't mind, :3.

For hippies: http://www.roblox.com/Peace-Shirt-TRANSPARENT-item?id=99429853
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
14 Dec 2012 04:53 PM
Well, Jelly, if you wanted to make a little bit more efficient:

script.Parent.MouseButton1Down:connect(function() -- don't mind the down...
if gui.Visible == false then gui.Visible = true
gui.Text = "Close"
else gui.Visible = false
gui.Text = "Open"
end end)

For hippies: http://www.roblox.com/Peace-Shirt-TRANSPARENT-item?id=99429853
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 04:54 PM
ikr, just wanting to blow his mind :L
Report Abuse
Colbie988 is not online. Colbie988
Joined: 03 Mar 2012
Total Posts: 885
15 Dec 2012 06:08 PM
Lol btw thx for the scripts guys.
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