Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 26 Jun 2013 06:48 AM |
function onEquipped() script.Parent.GUI.Parent = game.Players.LocalPlayer.PlayerGui end
function onUnequipped() if game.Players.LocalPlayer.PlayerGui:findFirstChild("GUI")then game.Players.LocalPlayer.PlayerGui:findFirstChild("GUI").Parent = script.Parent end end
script.Parent.Equipped:connect(onEquipped) script.Parent.Unequipped:connect(onUnequipped)
I put this in a local script. |
|
|
| Report Abuse |
|
|
Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 26 Jun 2013 06:53 AM |
| Whenever I equip the tool the Gui doesn't appear |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 26 Jun 2013 06:54 AM |
hm... Dunno if it works, I don't know which circumstances you're under. If there's a script changing the name of the Players service, then no, ect.
Also, you can make your script better and more flexible by: 1) Cloning the GUI 2) Storing the cloned GUI as a variable. (3) Use :GetService or :service? Dunno.)
local tool = script.Parent local gui = script:FindFirstChild("GUI") if not gui then return end local clonedgui
tool.Equipped:connect(function(mouse) clonedgui = gui:clone() clonedgui.Parent = game:service("Players").LocalPlayer:FindFirstChild("PlayerGui") end)
tool.Unequipped:connect(function() if clonedgui then clonedgui:Destroy() end end)
- As, not a +, but a - |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 26 Jun 2013 06:55 AM |
^ Woops, that script is if the ScreenGui named GUI is found inside the LocalScript you're running.
- As, call me master. And give me cake. omnom. c: |
|
|
| Report Abuse |
|
|
Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 26 Jun 2013 07:01 AM |
| Thanks master but I dun have cake :3 |
|
|
| Report Abuse |
|
|