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: I'm new to GUI's.

Previous Thread :: Next Thread 
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 05:36 PM
This is my first time working with a GUI, and I'm having a large amount of problems...
How I have it set up:
StarterGui
GuiMain -- A ScreenGui
Frame
script -- Controling the positioning, inside of Frame
TextButton -- Inside of the Frame
LocalScript -- Inside TextButton, tried with normal script as well.

Here is the script, I copied it from the wiki, but changed element to script.Parent:


function onClick()
print("Clicked")
end
script.Parent.MouseButton1Click:connect(onClick)

This does nothing and does not give output. Can I have some help please?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
16 Oct 2012 05:37 PM
You have to go to Test>Play Solo to test it.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
16 Oct 2012 05:37 PM
You made it so when the parent of the script is clicked it prints "Clicked". The parent of the script is GuiMain. This has to be in a TextButton.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 05:42 PM
Sorry, I stated that wrong. The LocalScript, which contains the code I mentioned, is inside of the TextButton.

And I tried play solo, and it still didn't give me output.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 05:58 PM
Bump.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 06:25 PM
Bump..
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 07:43 PM
Bump...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 07:44 PM
Local scripts don't do prints.
For test, do game.Workspace.Message.Text = "KK!"
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
16 Oct 2012 07:45 PM
@cnt, LocalScripts do print in Solo.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 07:48 PM
Ohh yea, put the scirpt in the button btw or change the connector to:

script.Parent["ButtonName"].MouseButton1Down
Report Abuse
Theawesomeguy1223 is not online. Theawesomeguy1223
Joined: 23 Apr 2011
Total Posts: 45
16 Oct 2012 08:00 PM
I know why because you have to choose what to click for instance:
function onClick()
script.Parent.Parent.Text = " Hi "
print("Clicked")
end
script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 08:14 PM
If I don't want to change the text, why would that be needed to make the script run? And yes, it is in the TextButton. Help please?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 08:18 PM
script.Parent.MouseButton1Down:connect(function()
print("It should work")
end)
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 08:48 PM
No, actually it didn't. Have I got it set up wrong? The LocalScript (I tried with a normal script as well) is inside a TextButton, which is inside a Frame, which is inside a ScreenGui. Help please?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 08:49 PM
srsly? is it exactly like this:

Player
-PlayerGui
--ScreenGui
---Frame
----Button
-----Script
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 09:12 PM
Yes. Do you want me to make a model as an example?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 09:13 PM
Sure i guess
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 09:19 PM
Alright, I made it. It's messing up though.. The three extra scripts in Workspace aren't supposed to be there, and nor are the Frame and TextButton parented to Workspace..
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 09:20 PM
And GuiMain is supposed to be in StarterGui, not Workspace..
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Oct 2012 09:22 PM
It clones to PLAYER when you play the game.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 09:23 PM
How does that affect

script.Parent.MouseButton1Down:connect(function()
print("It should work")
end)

?
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
16 Oct 2012 09:56 PM
Bump.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
16 Oct 2012 10:12 PM
First, ill do nothing cuz i think you already found out with so meny posts, so BUMP!
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
16 Oct 2012 10:12 PM
First, ill do nothing cuz i think you already found out with so meny posts, so BUMP!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
16 Oct 2012 10:12 PM
@king, learn some grammar and sense.
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