generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: GUI opening with tool

Previous Thread :: Next Thread 
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
22 Aug 2012 03:13 PM
How do I make a GUI pop-up when you select a tool? Ex. Tool=backpack, inventory GUI opens when selected.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:14 PM
Equipped event ​> Clones Gui

† KMXD †
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:14 PM
Use onselected and copy a gui in Lighting into the players PlayerGui.
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:14 PM
Sorry, Knightmare is right.
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
22 Aug 2012 03:15 PM
How do I use "Equipped event" in a script?

Idea:
on equipped: clone inventoryGUI

Is that right?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:17 PM
Assuming the script is a child of the tool:

script.Parent.Equipped:connect(function()
--Clone gui
end)

† KMXD †
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
22 Aug 2012 03:19 PM
Do I have to use a tool or hopperbin?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:20 PM
Tool for that specific event, though if you want to use a Hopperbin, replace "Equipped" with "Selected".

† KMXD †
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
22 Aug 2012 03:21 PM
Here's what I have:

print 'Inventory Ready'
script.Parent.Equipped:connect(function(clone "Inventory GUI")
--Clone gui
end)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:23 PM
That's what I gave you, but with useless crap... Here, put this in a LocalScript, inside the tool. Put the GUI in the tool, too.

local GuiName = "NameOfTheGui" --Put the name here, kk?

script.Parent.Equipped:connect(function()
script[GuiName]:Clone().Parent = Game.Players.LocalPlayer.PlayerGui
end)


† KMXD †
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
22 Aug 2012 03:27 PM
thank you

Sorry, I'm bad with scripts
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
23 Aug 2012 02:02 PM
The open script worked, thank you. But, I don't know how to make the GUI disappear when the tool is unselected.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
23 Aug 2012 02:25 PM
    local GuiName = "NameOfTheGui" --Put the name here, kk?
    script.Parent.Equipped:connect(function()
      script[GuiName]:Clone().Parent = Game.Players.LocalPlayer.PlayerGui
    end)
    
    script.Parent.Unequipped:connect(function()
      pcall(function()
       Game.Players.LocalPlayer.LocalGui[GuiName]:Destroy()
      end)
    end)

¤¤†KMXD†¤¤
Report Abuse
rjh25 is not online. rjh25
Joined: 18 Jul 2011
Total Posts: 41
23 Aug 2012 03:20 PM
Thank you, I'll update the script and like I said before, I'm bad at scripting, but I'll practice.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image