|
| 17 Apr 2014 12:23 PM |
| Anyone have a link so that when a parent brick is touched, it inserts a GUI from lighting into StarterGUI, and one that moves it back to lighting? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 12:32 PM |
| you can just make the Gui visible and invisible |
|
|
| Report Abuse |
|
|
Aethium
|
  |
| Joined: 29 Mar 2014 |
| Total Posts: 574 |
|
| |
|
|
| 17 Apr 2014 12:39 PM |
but if you want it that way:
---------------------------------------------------------------------------------
function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then
--copy from lighting to backpack gui = Instance.new("ScreenGui") gui = game.Lighting.GUI:clone() gui.Name = "GUI" gui.Parent = game.Players:FindFirstChild(part.Parent.Name).Backpack
--eliminate gui(in a different script) gui = game.Players:FindFirstChild(part.Parent.Name).Backpack.GUI gui:destroy() end end
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 01:01 PM |
So I put this in a part, ------------------------ function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then
--copy from lighting to backpack gui = Instance.new("ScreenGui") gui = game.Lighting.GUI:clone() gui.Name = "BlizzardGui" gui.Parent = game.Players:FindFirstChild(part.Parent.Name).Backpack
--eliminate gui(in a different script) gui = game.Players:FindFirstChild(part.Parent.Name).Backpack.GUI gui:destroy() end end
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 01:12 PM |
No. Put this in the one that makes the gui appear:
------------------------ function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then
--copy from lighting to backpack gui = Instance.new("ScreenGui") gui = game.Lighting.GUI:clone() gui.Name = "BlizzardGui" gui.Parent = game.Players:FindFirstChild(part.Parent.Name).Backpack
end end script.Parent.Touched:connect(touch)
-------------------------- and this in the one that makes the gui disappear:
------------------------ function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then
--eliminate gui(in a different script) gui = game.Players:FindFirstChild(part.Parent.Name).Backpack.GUI gui:destroy() end end
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 01:29 PM |
| 11:28:03.687 - GUI is not a valid member of Lighting |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 02:44 PM |
this one to make the gui appear:
---------------------------------------------------
function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then if game.Players:FindFirstChild(part.Parent.Name).PlayerGui:FindFirstChild("BlizzardGui") == nil then gui = Instance.new("ScreenGui") gui = game.Lighting.BlizzardGui:clone() gui.Name = "BlizzardGui" gui.Parent = game.Players:FindFirstChild(part.Parent.Name).PlayerGui end end end script.Parent.Touched:connect(touch)
-------------------------- this one to make the gui disappear:
------------------------ function touch(part) if game.Players:FindFirstChild(part.Parent.Name) then if game.Players:FindFirstChild(part.Parent.Name).PlayerGui:FindFirstChild("BlizzardGui") then gui = game.Players:FindFirstChild(part.Parent.Name).PlayerGui.BlizzardGui gui:destroy() end end end
script.Parent.Touched:connect(touch)
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jun 2014 11:38 PM |
| Thanks so much Manuel! Worked like a charm! |
|
|
| Report Abuse |
|
|