|
| 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 |
|
|
| |
|
|
| 27 Feb 2016 06:52 PM |
instead of cloning them, try putting them in frame and setting the frame to visible
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|