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: where did i get it wrong?

Previous Thread :: Next Thread 
Claverbot is not online. Claverbot
Joined: 01 Jul 2014
Total Posts: 73
27 Mar 2015 02:23 PM
i wanted to make open and close gui,but i cant open it!heres script:

OpenMe = script.Parent.OpenMe
Button = script.Parent.ButtonHere
Open = false

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

where did i get it wrong?
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
27 Mar 2015 02:30 PM
See the line where it says "Button.MouseButton1Down:connect(function(click)?"
Replace that with

function onButtonClicked()

and add this at the end of your script:

script.Parent.MouseButton1Click:connect(onButtonClicked) --Modify depending on where the script is.
Report Abuse
Claverbot is not online. Claverbot
Joined: 01 Jul 2014
Total Posts: 73
27 Mar 2015 02:52 PM
after 1 hour...i made another gui.WORKING GUI.but thx
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
27 Mar 2015 02:54 PM
klink, no.
That has no effect whatsoever.
Report Abuse
fishguy100 is not online. fishguy100
Joined: 16 Feb 2013
Total Posts: 3679
27 Mar 2015 02:55 PM
Congratulations!
Report Abuse
Claverbot is not online. Claverbot
Joined: 01 Jul 2014
Total Posts: 73
27 Mar 2015 02:57 PM
kk
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
27 Mar 2015 02:57 PM
the real error with your script,

using an elseif where an else would've worked great.

and change

if (Open == false) then
to
if not Open then

BTW, this has no effect on the error, it's just a clean-up of your script.
Report Abuse
Claverbot is not online. Claverbot
Joined: 01 Jul 2014
Total Posts: 73
27 Mar 2015 03:43 PM
ok
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Mar 2015 03:46 PM
OpenMe = script.Parent.OpenMe
Button = script.Parent.ButtonHere
Open = false

Button.MouseButton1Down:connect(function()
Open = not Open
if Open then
Button.Text = "Close"
OpenMe.Visible = false
else
Button.Text = "Open"
OpenMe.Visible = true
end
end)
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