So I was coding a button that closes and opens a GUI for a store. But while being afk I lost the data and it didn't save due to windows updating my computer randomly.
I tried to recreate the exact code and now I don't know whats wrong with it now.
script.Parent.storegui.Enabled = false script.Parent.storebutton.store.MouseButton1Down(function() if script.Parent.storegui.Enabled == false then script.Parent.storegui.Enabled = true else script.Parent.storegui.Enabled = false end end)
I've tried changing MouseButton1Down to MouseButton1Click, still it doesn't work. I don't think anything is deprecated so yeah.
Can someone tell me the problem? Thanks.
I think you should change the 'Enabled' to 'Visible', if this is not the problem, please tell me more about the situation or send me pictures of the properties and stuff. Here's the script that I think should work
script.Parent.storegui.Visible= false script.Parent.storebutton.store.MouseButton1Down(function() if script.Parent.storegui.Visible == false then script.Parent.storegui.Visible = true else script.Parent.storegui.Visible = false end end)
Also, is FE on?
Use the Player GUI:
local p = game.Players.LocalPlayer p.PlayerGui.storegui.Enabled = false -- Assuming that storegui is a ScreenGUI script.Parent.storebutton.store.MouseButton1Down:Connect(function() if p.PlayerGui.storegui.Enabled == false then p.PlayerGui.storegui.Enabled = true else then return end end)