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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

Ad

Answer this question