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

A tool that opens a gui?

Asked by
JJ_B 250 Moderation Voter
10 years ago

I've tried multiple things trying to get a tool that opens a gui upon equipping it and removing the gui when you put the tool away, but none work. Can anyone help me?

0
By the way, how do you do those Lua script boxes exactly like scripts on ROBLOX? JJ_B 250 — 10y
1
Hit the Lua logo when editing your post (it says "Code block" when hovered over) and insert your code inbetween the squigly lines (~~~~~~~~~~~~~~~~~) nate890 495 — 10y
0
put a startergui in it epic_hen9 27 — 3y

2 answers

Log in to vote
0
Answered by
nate890 495 Moderation Voter
10 years ago
local player = game.Players.LocalPlayer
local gui = player.PlayerGui.MyScreenGui

gui.Parent = nil

script.Parent.Equipped:connect(function(mouse)
    gui.Parent = player.PlayerGui
end)

script.Parent.Unequipped:connect(function(mouse)
    gui.Parent = nil
end)
1
Thanks a bunch! JJ_B 250 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Well, for one, this question can be answered by 3 links.

All what you will need to know, about Tools

Equipped Function

Unequipped Function

Utilize those.

2
Please refrain from just posting links, especially to the wiki. Try to write out a helpful answer. User#2 0 — 10y
0
Sorry that I do not want to encourage learking. I do not just give scripts, I help push them in the right direction for them to make it themselves. AmericanStripes 610 — 10y
0
As well, most people do not really know how to search for stuff that could help on the wiki. I am here to help, not give scripts. Thank you for the response though. :) AmericanStripes 610 — 10y
0
All 3 are expired :P HeadlessDeathSpeaker 9 — 5y

Answer this question