Hi i am new to developing and i am currently trying to make a menu GUI.
I have made it so the player would have to go and pick up a menu which works fine and the menu gets placed into their backpack. I also have the GUI made and a script which says the GUI enabled status is false until the player equips the menu but whenever i try to test run my game the GUI is on my screen until i go and grab a menu. I have tried placing the GUI into different locations but its either the GUI is enabled when it shouldn’t be or it doesn’t work at all.
Im not sure if i need to change my script? If anyone knows how to help please let me know!
A bit more organized code. Make sure your GUI’s enabled property is set to true, OR if it’s set to false by default, just enable it in the script.
local players = game:GetService("Players")
local player = Players.LocalPlayer
local playergui = player:WaitForChild("PlayerGui")
local menu = script.Parent
local menugui = playergui:WaitForChild("MenuGui")
menugui.Enabled = false
menu.Equipped:Connect(function()
menugui.Enabled = true
end)
menu.Unequipped:Connect(function()
menugui.Enabled = false
end)