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

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

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

3 answers

✓ Accepted answer

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

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!

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

4 comments

0

I dont really script but where would I put the code that makes it so the gui pops up.

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.

0

@ZeptixBlade - In my opinion @LocaiLua was being really nice. @AWESOMEnoob3 didn't provide a script, but @LocaiLua still gave him a hint.

0

@Zeptix OP needs to learn for himself tbh, @LocaiLua gave him a head start.

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