|
| 02 Dec 2017 05:37 PM |
Hey I have a customize button, and when you click it, it brings up the customization screen gui I made this normal script under a text button, under a screen gui, under startergui
gui = game.StarterGui.Customize-- customize is the name of the screen gui I want to bring up gui.Enabled = false
function onClicked(gui) gui.Enabled = true end script.Parent.MouseButton1Click:connect(onClicked)
It doesn't seem to work though, can anyone tell me why?
|
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 05:41 PM |
If I'm not mistaken you can't use Click on GUIs, try MouseButton1Down
|
|
|
| Report Abuse |
|
|
V_PN
|
  |
| Joined: 08 May 2011 |
| Total Posts: 121 |
|
|
| 02 Dec 2017 05:42 PM |
If the script is in the textbutton, which is in the screengui, and you're disabling the script. Then that stops all the events at once.
Doesnt it?
#code print('0') |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 05:42 PM |
Its a text button gui, sorry if I didn't mention that
|
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 05:42 PM |
| No, you've got it mixed up. You can't use Button1Click on the actual mouse object, but on gui buttons MouseButton1Click works fine. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 05:46 PM |
I disabled the customize screen gui, since thats the customization gui. I dont want it to be on the screen until the text button is clicked, thats why its not enabled until its clicked. Which doesn't seem to work.
Also this is not a local script, could that be a problem?
|
|
|
| Report Abuse |
|
|
| |
|
V_PN
|
  |
| Joined: 08 May 2011 |
| Total Posts: 121 |
|
|
| 02 Dec 2017 05:59 PM |
Try using a local script, server scripts tend to not work on client side stuff.
#code print('0') |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:05 PM |
Local script didn't seem to make a difference, although it said gui was nil so I got rid of that local variable. This is my current script now
game.StarterGui.Customize.Enabled = false
function onClicked(gui) game.StarterGui.Customize.Enabled = true end script.Parent.MouseButton1Click:connect(onClicked)
|
|
|
| Report Abuse |
|
|
V_PN
|
  |
| Joined: 08 May 2011 |
| Total Posts: 121 |
|
|
| 02 Dec 2017 06:13 PM |
game.StarterGui.Customize.Enabled = false
script.Parent.MouseButton1Click:connect(function() game.StarterGui.Customize.Enabled = true end)
#code print(' 0 ') |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:17 PM |
Weird, that script looks like its supposed to work, but it did not. I even tried changing it to
game.StarterGui.Customize.Enabled = false
script.Parent.MouseButton1Down:connect(function() game.StarterGui.Customize.Enabled = true end)
But even that would not work. Also tried in a normal script rather than a local one and still nothing ;l
|
|
|
| Report Abuse |
|
|
V_PN
|
  |
| Joined: 08 May 2011 |
| Total Posts: 121 |
|
|
| 02 Dec 2017 06:20 PM |
Is this script inside the 'Customize' GUI?
print(' #RAP ') |
|
|
| Report Abuse |
|
|
Denny9876
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 117 |
|
|
| 02 Dec 2017 06:21 PM |
You're using StarterGui, that's why. StarterGui takes effect on everyone but DOESN'T effect them until the player respawn.
Use a localscript, put this in StarterGui, and use this script :
game.Players.LocalPlayer.PlayerGui.Customize.Enabled = false
script.Parent.MouseButton1Down:connect(function() game.Players.LocalPlayer.PlayerGui.Customize.Enabled = true end) |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:23 PM |
I have 2 screen guis under StarterGui
The first one is "Customize" Its the the one that we want to enable
The second one is "maingui" Its where the text button called "Customize Button" is located and in there is the script we are working on.
So, the answer to your question is no.
|
|
|
| Report Abuse |
|
|
V_PN
|
  |
| Joined: 08 May 2011 |
| Total Posts: 121 |
|
|
| 02 Dec 2017 06:23 PM |
That flew right over my head ^
#code while true do end |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:30 PM |
@Denny
When you say put under StarterGui, do you mean just to put in there, or under one of the screen guis.
Because when its under StarterGui, the Customize screen gui is not visible, but does not become visible when the textbutton is clicked either.
When it is under maingui the customize screen gui is visible, which is not our goal since we wont it to become visible when the textbutton is clicked.
|
|
|
| Report Abuse |
|
|
Denny9876
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 117 |
|
|
| 02 Dec 2017 06:35 PM |
Put the localscript in the button, since your function has "script.Parent" in it.
The customize gui should be disabled on game run and once you click the button, it should become visible. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:38 PM |
The script does not work, I think this is why:
[Error] -Customize is not a valid member of PlayerGui
|
|
|
| Report Abuse |
|
|
Denny9876
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 117 |
|
|
| 02 Dec 2017 06:42 PM |
Strange, you do have a ScreenGui named "Customize" in the StarterGui right? It must be named exactly like "Customize" in case you put "customize" or some typo in the ScreenGui. Otherwise you didn't add it.
Also try putting wait() on the first line in the script. Maybe that'll give the game time to load the GUI before the script runs. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2017 06:44 PM |
Yeah, the wait worked.
Thanks so much for your help ;D
|
|
|
| Report Abuse |
|
|
Denny9876
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 117 |
|
| |
|