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: -on second click? (GUI)

Previous Thread :: Next Thread 
JamesBond1010 is not online. JamesBond1010
Joined: 06 Sep 2008
Total Posts: 1895
12 Nov 2011 12:24 PM
onClick it opens
onClick again it closes

How to make it like that? This is the script that needs to do the function above:

function onClicked(GUI)
h = script.Parent.Parent.Parent.Parent.Parent.Character:findFirstChild("Humanoid")
if (h ~= nil) then
script.Parent.Parent.Parent.Frame.Visible = true
else return end
end
script.Parent.MouseButton1Click:connect(onClicked)

Thank you.
Report Abuse
JamesBond1010 is not online. JamesBond1010
Joined: 06 Sep 2008
Total Posts: 1895
12 Nov 2011 12:25 PM
Bump
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
12 Nov 2011 12:26 PM
Use elseif or else
Report Abuse
JamesBond1010 is not online. JamesBond1010
Joined: 06 Sep 2008
Total Posts: 1895
12 Nov 2011 12:28 PM
Like this?


function onClicked(GUI)
h = script.Parent.Parent.Parent.Parent.Parent.Character:findFirstChild("Humanoid")
if (h ~= nil) then
script.Parent.Parent.Parent.Frame.Visible = true
elseif
script.Parent.Parent.Parent.Frame.Visible = false
 end
end
script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
31drake is not online. 31drake
Joined: 10 Dec 2010
Total Posts: 341
12 Nov 2011 12:29 PM
Um... You could make an active value, so if it's active and someones clicks it it is not active, and vice versa.

and make another script telling it what to do when it's active/ not active.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
12 Nov 2011 12:34 PM
or bool value :D
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