|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|