And it would only be appearing when the tool is selected. It will be gone when you deselect the tool or when you haven't selected it (just clarifying.)
You can put this in a hopperbin. Put the GUI in the hopperbin and name it 'Main_Gui' Also make sure that it's a local script.
This creates/removes the GUI each time you select/deselect the tool.
local tool = script.Parent local guiMain = tool['Main_Gui'] local guiClone = nil local select = function() if guiClone then return end guiClone = guiMain:Clone() guiClone.Parent = game.Players.LocalPlayer.PlayerGui end local deselect = function() if guiClone then guiClone:Destroy() end end tool.Selected:connect(select) tool.Deselected:connect(deselect)
You would use the hopperbin's Selected and Deselected properties, When selected you could set the gui's Visible property to true, and when deselected you could set the gui's Visible property to false.
Tool.Selected:connect(function() Gui.Visible = true end) Tool.Deselected:connect(function() Gui.Visible = false end)