Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

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

0
I don't understand the "local GUI -- put an = sign and change it to the GUI" Yuri_Development 0 — 6y
0
Basically you are assigning the variable GUI to the GUI of yours. Synxcious 2 — 6y
0
You would have thought a person with 223 rep would know how do edit their answers by now. T0XN 276 — 6y
1
actually I do know ^ greatneil80 2647 — 6y
Ad

Answer this question