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

How do you make a GUI appear when a tool is held?

Asked by
Rb2103 17
5 years ago

I am trying to make a tool which when selected it shows a GUI which will be able to control a system I am developing.

1 answer

Log in to vote
0
Answered by
orcazate 170
5 years ago

Ok so: Put your GUI into StartGui and turn the frame's visibility to false. (Use a local script for this)

local gui = game.Players.LocalPlayer.PlayerGui:WaitForChild("YOUR SCREEN GUI NAME HERE",5).YOUR FRAME NAME HERE

script.Parent.Equipped:Connect(function()

    gui.Visible = true
end)

script.Parent.Unequipped:Connect(function()
    gui.Visible = false
end)

Script.Parent being inside the tool like here:https://gyazo.com/ebf795437d388fc492584cbadb632f57

0
Cheers! Rb2103 17 — 5y
Ad

Answer this question