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

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

Asked by 3 years ago

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

0
this is what happens when I don't get sleep Roblox28721 10 — 3y
0
Me: “is there any syntax errors?” You: “No.” Me: “Yes… there is.” MAD_DENISDAILY2 137 — 3y
0
"VisAble" lol Roblox28721 10 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

it's Visible not Visable

0
There is still other stuff to be fixed MAD_DENISDAILY2 137 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

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. Roblox28721 10 — 3y
0
Ok I’ll edit it MAD_DENISDAILY2 137 — 3y

Answer this question