so what im trying to do is making a button with a shop icon (called Shopselect) and what i want it to do is open up a gui (called Shop)
COMMUNITY QUESTION
How to make a button that opens a gui?
2 answers
There are a ton of free models that offer scripts to do what you need, However here is i think what you want:
LocalScript btw
local Button = script.Parent
local Frame = script.Parent.Parent.Shop -- The place where your shop gui is at
local Debounce = false
Button.MouseButton1Up:Connect(function()
if Debounce == false then
Debounce = true
Frame.Visible = true -- Make the shop gui you are trying to show invisible btw
elseif Debounce == true then
Debounce = false
Frame.Visible = false
end
end)
Considering that the starterGui is setup like this:
starterGui localScript screenGui Shopselect toggleGui
you could do this:
script.Parent.screenGui.toggleGui.MouseButton1Click:Connect(function()
local button = script.Parent.screenGui.Shopselect
button.Visible = not button.Visible
button.Text = button.Visible and "Close Gui" or not button.Visible and "Open Gui"
end)
Haven't tested it, but should work.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
please put local infront of ur vars .-.
.-. really had to downvote me for that... functions just fine.
i willl test it.