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

Local Script Help?

Asked by 9 years ago

I could use a local script to open and close guis, in which the gui would only open for the specific player of whom clicked it.. correct?

0
Yup Vezious 310 — 9y
0
yep..... local scripts are localized to one player koolkid8099 705 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Here's the script. 1. Make a GUI and insert a Textbutton 2. Change the text of Textbutton to "Open" 3. Inside a Frame in the GUI together with the Textbutton. 4. Make a script or localscript >IN< the Textbutton (it's better to make it script so that it would take small loading time)

local button = script.Parent --Remove local if it's in a localscript
Open = false

button.MouseButton1Down:connect(function()
    if Open == false then
        Frame.Visible = true
        Open = false
        button.Text = 'Close'
    elseif Open == true then
        Frame.Visible = false
        Open = true
        button.Text = 'Open'
    end
end)
Ad

Answer this question