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 help

Previous Thread :: Next Thread 
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
06 Sep 2012 04:19 PM
Please help me fix this Code I made that makes it so that when I open a tool a GUI appears and when I close it it disappears.

tool.Equipped:connect(function()

game.StarterGui.Teleports.TTF.Visible = true

end)



tool.Unequipped:connect(function()

game.StarterGui.Teleports.TTF.Visible = false

end)
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
06 Sep 2012 04:24 PM
Firstly, you should be making changes to "PlayerGui" which is in the 'Player object' in game.Players. Secondly, you've not classified what "tool" is.
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
06 Sep 2012 04:27 PM
The tools name is tool.
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
06 Sep 2012 04:28 PM
Could you make the changes? (Not good with playergui things.)
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
06 Sep 2012 04:31 PM
Yes... The tools name may be tool but the script doesn't know that...

LocalScript:

script.Parent.Equipped:connect(function()
game.Players.LocalPlayer.PlayerGui.Teleports.TTF.Visible = true
end)

script.Parent.Unequipped:connect(function()
game.Players.LocalPlayer.PlayerGui.Teleports.TTF.Visible = false
end)

Should work.
Report Abuse
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
06 Sep 2012 05:09 PM
The script as you have it should work perfectly, except that you have it set to edit a Gui in StarterGui, whereas if you want to make a Gui appear for a certain player (the one who equips the tool) then you need to edit a Gui in that player's PlayerGui.


Gui = script.Parent.Parent.Parent.PlayerGui


adjust the amount of .Parent's to what you need.



--
これは私の署名である、それは日本語である
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