I'm trying to create a store GUI and I really need the .visible to work.
MainBack.HatsButton.MouseButton1Down:connect(function() MainBack.Visible = false Hats.Visible = true
When I click the button (ImageButton) it doesn't do anything. It is very essential that it works.
Fixed Code:
local Store = game.StarterGui.Store -- Don't use parent just put the gui in StarterGUI local MainBack = Store.MainBack local Trails = Store.Trails local Hats = Store.Hats local Guns = Store.Guns MainBack.HatsButton.MouseButton1Click:connect(function() -- Use MouseButton1Click MainBack.Visible = false Hats.Visible = true end)
If i'm correct this would work, if it does please accept this answer.
First, THIS IS A LOCAL SCRIPT DO NOT USE A REGULAR SCRIPT. Second, we need to see your variables! Here is a example, and make HatsButton a TextButton
local debounce = false local MainBack = game.Players.LocalPlayer.StarterGui function Open() if debounce = false then --Means this will not run multiple times at once, as it is not nessasary. local debounce = true MainBack.Visible = false Hats.Visible = true local debounce = false --makes the function usable again now end end MainBack.HatsButton.MouseButton1Click:connect(Open) --does the function we just made
Sure,
--Start of shop script local Store = game.StarterGui.Store Store.Parent = PlayerGui local MainBack = Store.MainBack local Trails = Store.Trails local Hats = Store.Hats local Guns = Store.Guns MainBack.HatsButton.MouseButton1Down:connect(function() MainBack.Visible = false Hats.Visible = true end)
Here is an image also: https://gyazo.com/2af0ab4813db4c39d7c94f59812783c8