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

Why won't GuiButton make my frame visibility to false when pressed?

I made a GuiButton that makes a frame visible if pressed the first time but then I want it to make the frame invisible if pressed again and for the cycle to repeat. Here is my code. I can't think straight.

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:Connect(function() player.PlayerGui.Store.Frame.Visable = true end)

if player.PlayerGui.Store.Frame.Visable = true then player.PlayerGui.Store.Frame.Visable = false end

3 comments

0

this is what happens when I don't get sleep

0

Me: “is there any syntax errors?” You: “No.” Me: “Yes… there is.”

0

"VisAble" lol

2 answers

Try this:


local player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:Connect(function()
player.PlayerGui.Store.Frame.Visible = true
if script.Parent.MouseButton1Down then
player.PlayerGui.Store.Frame.Visible = false
end
end)

Srry for the bad formatting on mobile

2 comments

0

Ok so I fixed every thing but it doesn't work, it's a problem of the script in general. Im ready to accept your next answer.

0

Ok I’ll edit it

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