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: GUI Help [should be easy]

Previous Thread :: Next Thread 
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 08:41 AM
So I'm making a command GUI that fires functions when a player presses a button.
Try it out here:

http://www.roblox.com/games/193975441/Proxs-Command-GUI-testing

It's still a work in progress (and I started work on it a day ago), but it's improving every single day.

Anyways, what I need help with is the "Hide/Show" button that should hide/show the GUI when clicked. I wrote a script for this button as well, which doesn't work. The script is very messy. I made it in about 2-3 minutes, and didn't think about logic and events really well:

script.Parent.MouseButton1Down:connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
if v.Name == "decrease_health" or v.Name == "help" or v.Name == "fire" or v.Name == "light" or v.Name == "increase_health" or v.Name == "kill" or v.Name == "leave" or v.Name == "remove_hats" or v.Name == "remove_left_arm" or v.Name == "remove_left_leg" or v.Name == "remove_right_arm" or v.Name == "remove_right_leg" or v.Name == "smoke" or v.Name == "explode" or v.Name == "sparkles" then
if v.Visible == true then
v.Visible = false
script.Parent.Text = "Show"
elseif v.Visible == false then
v.Visible = true
script.Parent.Text = "Hide"
end
end
end
end)

The script is in a LocalScript, which is in the TextButton.
Could anyone help me with this? Thanks.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
11 Apr 2015 08:46 AM
stuff = {"decrease_health","help","fire","light","increase_health","kill","leave","remove_hats","remove_left_arm","remove_left_leg","remove_right_arm","remove_right_leg", "smoke","explode","sparkles"}
script.Parent.MouseButton1Down:connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
for ii, vv in pairs(stuff) do
if v.Name == vv then
if v.Visible == true then
v.Visible = false
script.Parent.Text = "Show"
elseif v.Visible == false then
v.Visible = true
script.Parent.Text = "Hide"
end
end
end
end
end)

try that
Report Abuse
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 08:53 AM
Didn't work.
Report Abuse
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 09:03 AM
b
Report Abuse
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 09:06 AM
b2
Report Abuse
DuskErruptor is not online. DuskErruptor
Joined: 23 Jun 2013
Total Posts: 752
11 Apr 2015 09:24 AM
Playing Battleship?
Report Abuse
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 09:28 AM
a1
Report Abuse
Proxemics is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
11 Apr 2015 09:29 AM
e3
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
11 Apr 2015 09:33 AM
stuff = {workspace.script,workspace.script2}
script.Parent.MouseButton1Down:connect(function()
for i,v in pairs(script.Parent:GetChildren()) do
for ii, vv in pairs(stuff) do
if v.Name == vv.Name then
if v.Visible == true then
v.Visible = false
script.Parent.Text = "Show"
elseif v.Visible == false then
v.Visible = true
script.Parent.Text = "Hide"
end
end
end
end
end)
Report Abuse
DuskErruptor is not online. DuskErruptor
Joined: 23 Jun 2013
Total Posts: 752
11 Apr 2015 09:49 AM
You sunk my battleship...


:<
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