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 » Scripters
Home Search
 

Re: GuiButton Help!

Previous Thread :: Next Thread 
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
27 Feb 2016 06:37 PM
Alright, before I post my problem I rather not see everyone backlash at me for asking a question. Yes, I checked the wiki, and youtube videos and found nothing. So now that I got that out of the way, here it is.

My problem: I created a ScreenGui called, "WelcomeUi" in it is a Frame called, "MainUi" which houses 3 buttons. The buttons are as follows: Customize, Shop and Teams. In ReplicatedStorage are 3 ScreenGui's called, "CustomizeUi", "ShopUi", and "TeamUi".

What I want to do: by default the WelcomeUi spawn when the player joins. Furthermore, it is located in StarterGui. As he/she joins the menu pops up. The buttons; named above are clickable. The general idea is to have the player click the button and the following corresponding ScreenUi appears. For instance, if player clicks ShopButton then the ScreenUi called "ShopUi" will be cloned from ReplicatedStorage and placed into the player backpack. I need help to try to do this for all the buttons. All of this runs through a LocalScript placed in the "WelcomeUi".

The Chain of the ScreenUi(WelcomeUi)

WelcomeUi
LocalScript
MainUi(Frame)
Customize(GuiButton)
Shop(GuiButton)
Teams(GuiButton)

------------------------
RS = game:GetService("ReplicatedService") --- I hate using "ReplicatedStorage" every time I use it so I used "RS".
Player = game.Players.LocalPlayer --- Player
------------------------
WelcomeUi = script.Parent --- LocalScript is in the ScreenGui called "WelcomeUi"
------------------------
ShopButton = WelcomeUi.MainUi.Shop
CustomizeButton = WelcomeUi.MainUi.Customize
TeamButton = WelcomeUi.MainUi.Teams
------------------------
local TeamUi = RS.TeamUi
local CustomizeUi = RS.CustomizeUi
local ShopUi = RS.ShopUi
------------------------

function Team()
local TeamUi2 = TeamUi:Clone()
TeamUi2.Parent = Player.PlayerGui
end

function Customize()
local CustomizeUi2 = CustomizeUi:Clone()
CustomizeUi2.Parent = Player.PlayerGui
end

function Shop()
local ShopUi2 = ShopUi:Clone()
ShopUi2.Parent = Player.PlayerGui
end

------------------------
TeamButton.MouseButton1Click:connect(Team) --- Binds Function when mouse clicks it.
CustomizeButton.MouseButton1Click:connect(Customize) --- Binds Function when mouse clicks it.
ShopButton.MouseButton1Click:connect(Shop) --- Binds Function when mouse clicks it.
------------------------

When I click the Button(s) nothing shows up. How could I fix this? I have stubbled upon something I could not solve even after research. The wiki does a really bad job at explaining "MouseButton1Click:connect()".

Thanks for your help in advanced! Sorry, if my grammar wasn't on point.
Report Abuse
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
27 Feb 2016 06:46 PM
Bump...
Report Abuse
Reset2378658 is not online. Reset2378658
Joined: 21 May 2015
Total Posts: 4374
27 Feb 2016 06:52 PM
instead of cloning them, try putting them in frame and setting the frame to visible



Report Abuse
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
27 Feb 2016 08:07 PM
How so?
Report Abuse
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
27 Feb 2016 08:51 PM
Bump
Report Abuse
wolfbane3333 is not online. wolfbane3333
Joined: 03 Jan 2012
Total Posts: 126
27 Feb 2016 09:41 PM
I don't believe you can create a clone variable. Try this instead:

function Team()
TeamUi:Clone().Parent = Player.PlayerGui
end
Report Abuse
wolfbane3333 is not online. wolfbane3333
Joined: 03 Jan 2012
Total Posts: 126
27 Feb 2016 09:43 PM
Also, I don't see any ReplicatedService in the studio. Correct me if I'm wrong, but I believe it's supposed to be ReplicatedStorage.
Report Abuse
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
28 Feb 2016 07:15 AM
@Wolf, I found the issue plus some help from a friend. I by mistake labeled the first line, "ReplicatedService" when it should have been "ReplicatedStorage". Thanks for your help
I'm finding this error.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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