octavodad
(octavo)
September 5, 2020, 4:06am
#1
Hey guys, I made a simple open and close gui. It doesn’t open for some reason though.
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.MainFrame.Visible = not script.Parent.Parent.MainFrame.Visible
end)
Help is needed quickly, thanks.
2 Likes
Crysta1Egg
(Robloxian)
September 5, 2020, 4:09am
#2
A simple fix would be
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.MainFrame.Visible == true then
script.Parent.Parent.MainFrame.Visible = false
else
script.Parent.Parent.MainFrame.Visible = true
end
end)
If this Helps, please accept answer. thanks :)
1 Like
octavodad
(octavo)
September 5, 2020, 4:12am
#3
Still doesn’t work, unfortunately, sorry.
This doesn’t allow for a toggle however. You would have to use “not” to inverse the current visibility for it to toggle.
1 Like
Are you getting any errors in the output?
Also, are you sure that your Frame is on screen? If you manually toggle the visibility, does it appear on screen?
1 Like
Crysta1Egg
(Robloxian)
September 5, 2020, 4:15am
#6
Sorry i did not see the toggle, I rewrote the code.
1 Like
octavodad
(octavo)
September 5, 2020, 4:15am
#7
Ooof, for some reason it doesn’t pop up when I toggle the visibility. Any idea why?
Ulxqra
(Ulxqra)
September 5, 2020, 4:16am
#8
Rewrite the script. I know this sounds stupid but it probably will work. There is probably a tiny error. The script should work tho
1 Like
What exactly is supposed to be in the Frame? Are you sure it has contents and isn’t transparent? Is it’s .Position on screen? Is it’s .Size large enough to be seen?
1 Like
octavodad
(octavo)
September 5, 2020, 4:17am
#10
Ok, for some reason I can’t see it when I toggle visiblity manually in game. How can I fix?
octavodad
(octavo)
September 5, 2020, 4:17am
#11
Nope, position is fine. Size is fine. Transparency is fine.
Ulxqra
(Ulxqra)
September 5, 2020, 4:18am
#12
script.Parent.BackroundTransparency = 0
script.Parent.Position = Udim2.new(0.5,0, 0.5,0)
1 Like
You didn’t answer all my questions. What is the Frame supposed to represent? Was it able to be seen at a previous point?
1 Like
Crysta1Egg
(Robloxian)
September 5, 2020, 4:19am
#14
I think he just wants a Open and close script not a reposition script.
octavodad
(octavo)
September 5, 2020, 4:20am
#15
Ok, in studio it can’t be seen either for some reason
Crysta1Egg
(Robloxian)
September 5, 2020, 4:21am
#17
Do you have the ScreenGui Enabled = true?
screenGui is the script.Parent.Parent
1 Like
Ulxqra
(Ulxqra)
September 5, 2020, 4:21am
#18
Omg, the script SETS everything so it is not visible. I am not dumb
Is the parent ScreenGui Enabled?
Ulxqra
(Ulxqra)
September 5, 2020, 4:21am
#20
Make sure the: Screen GUI is enabled, it is visible, background transparency is 0 and the position is on screen
octavodad
(octavo)
September 5, 2020, 4:22am
#22
Ok lets test in game now, hope
1 Like