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

Im trying to find an open/close for my starter GUI? [closed]

Asked by 5 years ago

Im trying to find an open/close script for my start gui, but they all seem to not work or are scripted in a way a cant edit. Im not sure if im suppost to use a frame with the 3 text buttons i have in this ui but all the scripts ive been looking at or finding have been scripted that way. Im just looking for a simple fix.

Ignore the weird question mark in the title for some reason it had to be there.

Closed as Not Constructive by WideSteal321, starmaq, User#24403, and EpicMetatableMoment

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
starmaq 1290 Moderation Voter
5 years ago

Welp, you can't really ask for requests here but sure i'll show you, this doesn't use any scripting knowledge, it's just a smart setup only using variables. Now obviously your gui is gonna have a button, either a text button or an image button, im not sure how you set it up so you may wanna do some changes in your script, we are going to use a local script since all ui objects are local,

local frame = script.Parent.Parent -- this is your main ui that is a parent of all other uis
local button = script.Parent -- or wherever your button is
local open = false -- this var that is storing a boolean value is gonna determind if our gui is open or closed, you wanna set it to false by default since your ui is gnna be closed at first

button.MouseButton1Click:Connect(function() --this is the event that were gonna use, it fires when the ui is clicked
    if open == false then
        open = true
        frame.Visible = true
    else
        open = false
        frame.Visible = false
    end
end)


and that's really it, the Visible propety isprety much self explainbale, if its false local player wont see the ui, if its true he does.

I notice that you have no knowledge of scripting, and that's relly bad to just always ask others to make them stuff, start learning!

0
you can not just use frame.Visible = not frame.Visible ? and you can only use button.Actived yHasteeD 1819 — 5y
0
what? did i do anything wrong starmaq 1290 — 5y
0
No, but it would be much simpler to use this, using this you dont need variable. if you want to make this only change the open/close to frame.Visible = not frame.Visible and on button.MouseButton1Click change to button.Actived (you dont need to use this, only if you like) yHasteeD 1819 — 5y
0
yah button.Activated is a thing, but idk 99% people use the MouseButton1Click event starmaq 1290 — 5y
View all comments (3 more)
0
oh ok, you might be right, i use this since i started scripting, ty for telling me! starmaq 1290 — 5y
0
button.Actived does the same thing literally yHasteeD 1819 — 5y
0
yahyah ik now starmaq 1290 — 5y
Ad