Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problems with scripting a shop GUI. I am a noob in this. Could you help me?

Asked by 5 years ago
Edited by M39a9am3R 5 years ago

Hello everyone.

It may be easy, but I am new in scripting and I don't know how to script the GUI to hide one and show another when clicked a button.

After clicking a button you have few categories to choose from and then there should be option to buy the T-Shirt.

I have the guis done but I need the scripting... https://cdn.discordapp.com/attachments/623514573076692993/623525441038188573/Zrzut_ekranu_2019-09-17_o_16.27.12.png

The GUI will be for the shop where you can buy products via T-shirt payment. There should be place for decal photos and description.

Could you help, please?

0
the image is blocked Gameplayer365247v2 1055 — 5y
0
image blocked Freddan2006YT 88 — 5y
0
Please do not offer rewards for services. This goes against our guidelines and the purpose of our website. M39a9am3R 3210 — 5y
0
Don't offer robux to people who help you with your question!\ BashGuy10 384 — 5y

1 answer

Log in to vote
0
Answered by
Miniller 562 Moderation Voter
5 years ago
Edited 5 years ago

Okay, so the real question is How to show a button when clicking one right? So you click A, A hides then B appears? Easy.

First of all, make sure that B is not Visible. B.Visible = false (I'm using A and B, you have to do this with e.g gui.Frame.TextButton.Visible = false for the second button)

Now, only A is visible.

A.MouseButton1Click:Connect(function(player)
    B.Visible = true
    A.Visible = false
end)

Above you can see the code. As I mentioned, A should be e.g gui.Frame.TextButton or something, refer to that button.

Then this will hide A and show B.

Please note that you should use LocalScript or a normal script. Usually I would do a normal script and then use the player variable to refer to the player, but I think (I'm not sure, please don't judge me for this) you can use a LocalScript and do game.Players.LocalPlayer. But I prefer a normal script.

So this is how you do this.

I'm assuming that the other parts are already done. Also you can use the script but replace A with B and B with A to do the opposite.

Ad

Answer this question