Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a tool (supposedly a weapon) that allows a gui to appear and disappear on equip?

How do I make a tool (supposedly a weapon) that allows a gui to appear and disappear on equip? I want my gui to appear on equip and disappear on de-equip. This would be made to be equipped multiple times without deleting the gui. GUI would be named "GunGUI"

1 answer

✓ Accepted answer

the word GUI must be defined and it must be a frame, if it is a ScreenGui, change Gui.Visible to Gui.Enabled

local tool = script.Parent
local GUI  -- put an = sign and change it to the GUI

if tool.Equipped = true then -- may not work / may work, change it to == if it doesn't work
	GUI.Visible = true
elseif tool.Equipped = false then -- may not work / may work, change it to == if it doesn't work
	GUI.Visible = false
end

I forgot if i need to make the if statements an == instead of an = Thx, accept answer if works

Edit 1: The local GUI must be defined in order to work.. The local GUI is the gui that you want to make visible / invisible

4 comments

0

I don't understand the "local GUI -- put an = sign and change it to the GUI"

0

Basically you are assigning the variable GUI to the GUI of yours.

0

You would have thought a person with 223 rep would know how do edit their answers by now.

1

actually I do know ^

This discussion is preserved as it was. New answers, comments, and votes are closed.