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

How can I make a GUI pop up when a tool is equipped?

Asked by 9 years ago

I need this because my friend is making a game and I need people to know what tool there using.

3 answers

Log in to vote
-2
Answered by 9 years ago

Try this

Tool.Equipped:connect(function()

Gui.Visible = true

--or you can instance a new one

Instance.new("ScreenGui")

end)

You will need to make it the gui yourself

Ad
Log in to vote
0
Answered by 3 years ago

Try making a :Clone() like this:

script.Parent.Equipped(function()
    local GUI = script.Parent.GUI:Clone()
    GUI.Parent = game:GetService("Players").LocalPlayer.PlayerGui
    GUI.Main:TweenPosition(UDim2.new(0.318, 0,0.159, 0))
end)

script.Parent.Unequipped(function()
GUI:Destroy()
end)

or you can do a simple script that makes a Frame become Visible like this:

local Gui = game.StarterGui.Gui.Main
script.Parent.Equipped(function()
    Gui.Visible = true
end)
script.Parent.Unequipped(function()
    Gui.Visible = false
end)

Hope it helped!

Log in to vote
-1
Answered by 9 years ago

Try to use http://wiki.roblox.com/index.php?title=Equipped_(Event) Like: Tool.Equipped:connect(function() print'Equipped' end)

0
I dont really script but where would I put the code that makes it so the gui pops up. AWESOMEnoob3 3 — 9y
0
That code doesn't make the GUI pop up. Learn to script before asking a question, then use the Equipped event to make the GUI visible. ZeptixBlade 215 — 9y
0
@ZeptixBlade - In my opinion @LocaiLua was being really nice. @AWESOMEnoob3 didn't provide a script, but @LocaiLua still gave him a hint. Link43758 175 — 9y
0
@Zeptix OP needs to learn for himself tbh, @LocaiLua gave him a head start. Spongocardo 1991 — 9y

Answer this question