|
| 02 Jul 2013 07:02 PM |
the script is meant to make a button with a click detector activate a gui that simply says "Oak Tree". I have a GUI set up like this StarterGui > OTgui > Frame > Textbox >script any help? ask if you need more information.
clickDetector = script.Parent
clickDetector.MouseClick:connect(function(player) repeat wait() until player:findFirstChild("PlayerGui") gui = player.PlayerGui:findFirstChild("otgui") if not gui then return end frame = gui:findFirstChild("frame") if not frame then return end frame.Visible = true wait (3) frame.Visible = false end) |
|
|
| Report Abuse |
|
|
| |
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jul 2013 07:14 PM |
| So this script is in a Textbox and you're using the MouseClick event? No. You use MouseButton1Click (or MouseButton1Down, either way) for TextBoxes, and you'll have to get the player a different way. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 07:29 PM |
| what do you mean, "get the player another way" |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jul 2013 07:30 PM |
Through a series of Parents or if you had this in a local script, local Player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 07:34 PM |
| so... i just put the script into a local script. that's all i derived from that statement |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 07:36 PM |
| so what exactly do i need to do to the script or what edits do i make to the part? |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jul 2013 07:41 PM |
._.
script.Parent.MouseButton1Click:connect(function() local Player = script.Parent.Parent.Parent.Parent.Parent local GUI = Player.PlayerGui:FindFirstChild("otgui") local Frame = GUI:FindFirstChild("frame") if GUI and Frame then Frame.Visible = true wait (3) Frame.Visible = false end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jul 2013 07:46 PM |
here are the details of my game here
the button that is activating the GUI
Workspace > Oak > Click Detector & Local Script ------------------------------------------------------------------------------------ the local script is
script.Parent.MouseButton1Click:connect(function() local Player = script.Parent.Parent.Parent.Parent.Parent local GUI = Player.PlayerGui:FindFirstChild("otgui") local Frame = GUI:FindFirstChild("frame") if GUI and Frame then Frame.Visible = true wait (3) Frame.Visible = false end end) ----------------------------------------------------------------------------------------- the GUI
StarterGui > otgui > Frame (invisible) > Textbox (visible) > script ------------------------------------------------------------------------------------------ that script says:
clickDetector.MouseClick:connect(parent.StarterGui.ScreenGui visible=true) |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jul 2013 07:49 PM |
"it is not working"
Invalid response. I demand output. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 07:51 PM |
| ??? don't get sardonic with me. ??? |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jul 2013 07:56 PM |
Ok, here's what you only need to tell me:
- Output, if any, from my previous post. - How you have your GUI set up (I may of messed up the parenting).
Now I want you to disregard anything localscript related from your mind. I want you to go back to the beginning and work around with the code I gave you. Use it in a normal script that is in the Textbox |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 08:05 PM |
| I posted parenting earlier and I put the script in the textbox or in the part that is the button? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 08:05 PM |
| add me so we can talk in a party |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 08:06 PM |
| i sent you a friend request. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jul 2013 01:02 AM |
| I thought local scripts didn't work if they are in Workspace. Don't they need to be in the player's backpack or playerGUI? |
|
|
| Report Abuse |
|
|
| |
|
| |
|