BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:22 PM |
My button script won't work. Help?
Code:
function onClick() game.StarterGui.HelpGui.Frame.HelpText.Visible = true end
script.Parent.MouseButton1Down:connect(click)
|
|
|
| Report Abuse |
|
|
yoyoman2
|
  |
| Joined: 07 Mar 2009 |
| Total Posts: 2170 |
|
|
| 25 Jul 2011 01:26 PM |
i think its like this:
function onClick() game.StarterGui.HelpGui.Frame.HelpText.Visible = true end
script.Parent.MouseButton1Click:connect(click)
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 01:28 PM |
lolnope
Put this in a LocalScript
function onClick() game.Players.LocalPlayer.PlayerGui.Frame.HelpText.Visible = true end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:29 PM |
| In a LocalScript or regular? |
|
|
| Report Abuse |
|
|
| |
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:30 PM |
@Swim
It's in StarterGui, not PlayerGui. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 01:31 PM |
| Yes, but when someone enters the game, everything in StarterGui is copied and put in their PlayerGui automatically. If you change things in the StarterGui, nothing will happen. If you change things in people's PlayerGui's, then you can see what changes. |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:32 PM |
| Ok. Thanks. Let me test it real quick. |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
| |
|
|
| 25 Jul 2011 01:36 PM |
Hold up, are all of the GUI's in a ScreenGui? I saw
PlayerGui.Frame
Is the ScreenGui named Frame? |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:38 PM |
| Look in my models for a model that says HelpGUI. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 01:50 PM |
Ok, first problem:
Your 'Help' textbutton has the size of UDim2.new(0,0,0,0) meaning, it basically doesn't exist. Hence, nothing happens when you click it. Because it's not actually there.
Second:
Not really a problem, but Frame doesn't really need to be there. You can make your textbutton look like that.
Third: You can just use script.Parent instead of game.Players.LocalPlayer.blablabla
Last:
DO NOT USE TEXTBOXES FOR SHOWING TEXT! Major unhappyness results from this. Use TextLabels instead. Textboxes are editable, meaning people can type in them. TextLabels just sit there and show text.
I'm not going to give you the fixed version, I want to see if you can do it yourself :) |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
| |
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 01:58 PM |
| Wait, what would the size be then? |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:00 PM |
| Same size of the Frame, which you don't need. |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 02:03 PM |
| Ok. One last question, the frame of the button or the frame of the text? |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:05 PM |
| You don't need the frame around the button. But the way you have it set up, if you delete it, you'll delete everything you've done. So copy everything in the frame, delete the frame, and paste everything back in the ScreenGui. |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 02:11 PM |
| Ok. I did that. But it still doesn't work. I can click the button but the text won't pop up. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:16 PM |
| *cough*script.Parent.HelpText.Visible = true*cough* |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 02:19 PM |
| Lol. I had that EXACT same code. But, I deleted it cause I thought it wouldn't work. xD. Thank you so much. It works! |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 02:23 PM |
| Now I gotta make the close button xD |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:30 PM |
Take above code, and reverse the true, put it as false, and put it into ur close button xD
-PostBumped |
|
|
| Report Abuse |
|
|
BetaWolfE
|
  |
| Joined: 07 Mar 2011 |
| Total Posts: 63 |
|
|
| 25 Jul 2011 02:33 PM |
| Too bad that didn't work xD |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:33 PM |
| *cough*script.Parent.Parent.Visible = false*cough* |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2011 02:37 PM |
@swim
Pretty bad cold you got there O_o |
|
|
| Report Abuse |
|
|