How would i make a GUI only appear when a tool is equipped?

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! :slight_smile:

https://devforum.roblox.com/search?q=tool%20gui
If you have a script then you should provide it.

1 Like

local player = game.Players.LocalPlayer
local playergui = player.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)

This is the script that i currently have inside of the menu tool.

Do you disable the GUI before testing it?

The enabled should not be ticked.

1 Like

I just unchecked enabled and now its works! Thankyou!

1 Like

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)
1 Like

Thankyou will use this code as mine was rough haha xD