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: what is wrong with this script?

Previous Thread :: Next Thread 
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 07:11 PM
bump
Report Abuse
Voidion is not online. 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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 07:29 PM
what do you mean, "get the player another way"
Report Abuse
Voidion is not online. 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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
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 is not online. 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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 07:43 PM
it is not working
Report Abuse
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
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 is not online. 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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 07:51 PM
??? don't get sardonic with me. ???
Report Abuse
Voidion is not online. 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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 08:05 PM
add me so we can talk in a party
Report Abuse
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
02 Jul 2013 08:06 PM
i sent you a friend request.
Report Abuse
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
03 Jul 2013 12:02 AM
Bump
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
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
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
03 Jul 2013 07:46 PM
bump
Report Abuse
Sekheret332 is not online. Sekheret332
Joined: 22 Nov 2011
Total Posts: 490
05 Jul 2013 10:13 AM
bump
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