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 3 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 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

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

local Frame = script.Parent.Parent.Frame
local OpenButton = script.Parent
local Open = false

OpenButton.MouseButton1Click:Connect(function()
    if Open == false then
        Open = true
        --[[Optional:
        Open.Text = "Close Shop"
        ]]--
        Frame.Visible = true
    elseif Open == true then
        Open = false
        --[[Optional:
        Open.Text = "Open Shop"
        ]]--
        Frame.Visible = false
    end
end)

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 3 years ago

please say answered

Answer this question