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

Can someone please tweak my script and tell me what I did wrong? (I'm trying to make a shop GUI)

Asked by 4 years ago

Note: The frame is not the parent of the text button

script.Parent.MouseButton1Down:Connect(function() script.Parent.Parent.Frame.Visible = true end)

0
pls use a code block Grazer022 128 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

I see what you are trying to do, and see no point in not helping out.

01local Frame = script.Parent.Parent.Frame
02local OpenButton = script.Parent
03local Open = false
04 
05OpenButton.MouseButton1Click:Connect(function()
06    if Open == false then
07        Open = true
08        --[[Optional:
09        Open.Text = "Close Shop"
10        ]]--
11        Frame.Visible = true
12    elseif Open == true then
13        Open = false
14        --[[Optional:
15        Open.Text = "Open Shop"
16        ]]--
17        Frame.Visible = false
18    end
19end)

To further explain the script, it is a open and close script that should be placed in the button, and also make sure that the frame and button are in the correct places.

Hope this helps, Happy scripting!

Ad
Log in to vote
0
Answered by 4 years ago

please say answered

Answer this question