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
 

Notepad tool, doesn't work the second time I equip it.

Previous Thread :: Next Thread 
Mockingbird2k is not online. Mockingbird2k
Joined: 19 Feb 2010
Total Posts: 56
01 Feb 2014 10:31 AM
My problem is that the GUI shows up the first time I equip the tool, and disappears after unequipping the tool. But the next time I equip the tool, it doesn't appear.
------------------------
Tool = script.Parent

function onEquippedLocal()
character = script.Parent.Parent
player = game.Players:GetPlayerFromCharacter(character)
guiMain = script.Parent.ScreenGui
guiMain.Parent = player.PlayerGui
end


function onUnequippedLocal()
guiMain.Parent = Tool
end


Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
01 Feb 2014 10:46 AM
Add the :clone() method and put the GUI in Lighting. IT works better there.

Tool = script.Parent

function onEquippedLocal()
character = script.Parent.Parent
player = game.Players:GetPlayerFromCharacter(character)
guiMain = game.Lighting.ScreenGui
guiMain:clone().Parent = player.PlayerGui
end


function onUnequippedLocal()
player.PlayerGui.ScreenGui:Destroy()
end


Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)

~Hope I helped, if you need a script, PM me. ~The G~ ~CAT General Shawnyg~
Report Abuse
Mockingbird2k is not online. Mockingbird2k
Joined: 19 Feb 2010
Total Posts: 56
01 Feb 2014 10:58 AM
This worked, thanks!
The only problem is that I want the text to be unique for every Notepad tool in circulation so people can leave hidden messages and stuff.
I am sure I can figure out how to work this out.
Thanks for your help :)
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