Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make a single line of function where you can close and open a shop gui?

I can't seem to get how to make the script work

here's the script:

  1. local see = true
  2. local frame = script.Parent.Parent.Frame.Visible
  3. script.Parent.MouseButton1Click:Connect(function()
  4.  while see do
    
  5.      script.Parent.Parent.Frame.Visible = true
    
  6.      print ("success")
    
  7.      see = false 
    
  8.      if see == false then
    
  9.         frame.Visble = false
    
  10.         see = true
    
  11.     end
    
  12. end
    

14 end)

can anyone explain to me how to make the script work so I can press a button to close or open a shop Gui?

1 answer

✓ Accepted answer

I've written these before Its doesn't work because Lua has this problem with comparing these types of values

code:

local frame = script.Parent.Parent.Frame
script.Parent.MouseButton1Click:Connect(function()
if frame.Visible == true then
frame.Visible = false
else
frame.Visible = true
end
end)

I think that should work :D

This discussion is preserved as it was. New answers, comments, and votes are closed.