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 » Scripters
Home Search
 

Re: Tool GUI (appear a gui)

Previous Thread :: Next Thread 
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:11 PM
I want a script that when we equip a tool, the GUI appears and when we unequip, it disappears.

Let's suppose that the gui is named "GUI"


Report Abuse
EataPig98 is not online. EataPig98
Joined: 01 Mar 2014
Total Posts: 173
14 Jul 2017 03:17 PM
--localscript inside tool with the gui inside the script
local player = nil
script.Parent.Equipped:connect(function()
player = game.Players:GetPlayerFromCharacter(script.Parent)
script.GUI.Parent = player.PlayerGUI
end)
script.Parent.Unequipped:connect(function()
player = game.Players:GetPlayerFromCharacter(script.Parent)
script.GUI.Parent = script
end)

should work
Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:21 PM
Thank you ^_^


Report Abuse
EataPig98 is not online. EataPig98
Joined: 01 Mar 2014
Total Posts: 173
14 Jul 2017 03:27 PM
no problem
Report Abuse
EataPig98 is not online. EataPig98
Joined: 01 Mar 2014
Total Posts: 173
14 Jul 2017 03:29 PM
whoops, i made a mistake, it should be GetPlayerFromCharacter(script.Parent.Parent)
Report Abuse
EataPig98 is not online. EataPig98
Joined: 01 Mar 2014
Total Posts: 173
14 Jul 2017 03:30 PM
and PlayerGUI should be PlayerGui
Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:33 PM
I noticed & fixed it already lol


Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:36 PM
Also, you should of made a variable GUI instead of doing script.GUI because once you want to unequip, the gui is in playergui and not in the script.

So i created a clone and i fixed all this stuff :P


Report Abuse
EataPig98 is not online. EataPig98
Joined: 01 Mar 2014
Total Posts: 173
14 Jul 2017 03:36 PM
just incase there are any other errors, just try:

wait()
local player = nil
script.Parent.Equipped:connect(function()
player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
script.GUI:Clone().Parent = player.PlayerGui
end)
script.Parent.Unequipped:connect(function()
player.PlayerGui.GUI:Destroy()
player = nil
end)

i tested it and it works perfectly.
Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:51 PM
no its ok, i already fixed it


Report Abuse
ReallyExpensive is not online. ReallyExpensive
Joined: 01 Apr 2013
Total Posts: 951
14 Jul 2017 03:53 PM
you really shouldn't of just gave him the script

he wont learn ;-;
Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
14 Jul 2017 03:53 PM
Expensive, are you kidding me i literally fixed the whole script i know all what he did in the code. I'm not the one who asks for a script and put it in my game like that.


Report Abuse
ReallyExpensive is not online. ReallyExpensive
Joined: 01 Apr 2013
Total Posts: 951
14 Jul 2017 04:12 PM
he still gave you the script.

you fixed a line or two
Report Abuse
Robotz04 is not online. Robotz04
Joined: 25 Feb 2011
Total Posts: 6369
15 Jul 2017 09:50 AM
i changed the whole code.
Report Abuse
Mine_rr is not online. Mine_rr
Joined: 09 Aug 2015
Total Posts: 35
17 Nov 2017 07:10 PM
Where should the tool be? I put it in Starter Pack and it wont work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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