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: Onbrick touched load GUI script?

Previous Thread :: Next Thread 
DarknessOfDestiny is not online. DarknessOfDestiny
Joined: 23 Apr 2012
Total Posts: 206
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
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
17 Apr 2014 12:32 PM
you can just make the Gui visible and invisible
Report Abuse
Aethium is not online. Aethium
Joined: 29 Mar 2014
Total Posts: 574
17 Apr 2014 12:34 PM
Touched
TouchEnded
Clone
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
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
DarknessOfDestiny is not online. DarknessOfDestiny
Joined: 23 Apr 2012
Total Posts: 206
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
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
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
DarknessOfDestiny is not online. DarknessOfDestiny
Joined: 23 Apr 2012
Total Posts: 206
17 Apr 2014 01:29 PM
11:28:03.687 - GUI is not a valid member of Lighting
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
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
DarknessOfDestiny is not online. DarknessOfDestiny
Joined: 23 Apr 2012
Total Posts: 206
17 Apr 2014 02:49 PM
Works!
Report Abuse
coolninja1234 is not online. coolninja1234
Joined: 15 Jul 2009
Total Posts: 128
11 Jun 2014 11:38 PM
Thanks so much Manuel! Worked like a charm!
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