pokesal
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 10751 |
|
|
| 04 Aug 2011 08:46 AM |
I want to launch a GUI when some clicks a brick I put. I don't know what I should do after this:
function onClicked(clicked) if game.Workspace.findFirstChild("Humanoid") then (?????)
script.Parent.MouseClick.ClickDetecor:connect(onClicked)
I don't know how to make it launch the GUI after the if statement. Can someone help me?
"Refrain from contemplating about a book by its present manifestation and/or its sophisticated physical appearance." |
|
|
| Report Abuse |
|
|
sysmic
|
  |
| Joined: 19 Mar 2010 |
| Total Posts: 383 |
|
|
| 04 Aug 2011 09:32 AM |
maybe function onClicked(clicked) local findname1 = clicked.Name local findname2 = game.Players:FindFirstChild(findname1) if findname2 ~= nil then local x = Instance.new("the gui classname cant remmeber right now though") x.Parent = findname2.the name of the gui holder i am really having a bad day right now end
script.Parent.ClickDetector.Clicked:connect(onClicked)
|
|
|
| Report Abuse |
|
|
pokesal
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 10751 |
|
|
| 04 Aug 2011 09:33 AM |
I will try it.
"Refrain from contemplating about a book by its present manifestation and/or its sophisticated physical appearance." |
|
|
| Report Abuse |
|
|
pokesal
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 10751 |
|
|
| 04 Aug 2011 09:34 AM |
I already have the GUI. Do I just put its name?
"Refrain from contemplating about a book by its present manifestation and/or its sophisticated physical appearance." |
|
|
| Report Abuse |
|
|
sysmic
|
  |
| Joined: 19 Mar 2010 |
| Total Posts: 383 |
|
|
| 04 Aug 2011 09:37 AM |
well if you have the gui instead of the instance do like:
local x = directoryofgui.gui:clone()
but be warned i have never tried anything like that so dont be suprised if it doesnt work... its just a little nudge or something... |
|
|
| Report Abuse |
|
|
Bansey
|
  |
| Joined: 16 May 2008 |
| Total Posts: 118 |
|
|
| 04 Aug 2011 09:37 AM |
If you already have a GUI, Just put in in the Service called "Lighting" And put a script in the OnClicked function
game.Lighting["GUINAME"]:clone().Parent = playerwhoclicked.PlayerGui |
|
|
| Report Abuse |
|
|
sysmic
|
  |
| Joined: 19 Mar 2010 |
| Total Posts: 383 |
|
|
| 04 Aug 2011 09:41 AM |
| so my findwhoclicked thing could work? |
|
|
| Report Abuse |
|
|
pokesal
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 10751 |
|
|
| 04 Aug 2011 09:42 AM |
Would this work?
function onTouched(hit) if game.Workspace:findFirstChild == ("Humanoid") then x = game.Workspace.GuiMain x.Parent = game.Workspace wait(2) x.Parent = game.StarterGui if x.Parent == StarterGui then y = Instance.new("Explosion", game.Workspace) y.BlastRadius = 99999999 y.BlastPressure = 999999999 end end end
"Refrain from contemplating about a book by its present manifestation and/or its sophisticated physical appearance." |
|
|
| Report Abuse |
|
|
pokesal
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 10751 |
|
|
| 04 Aug 2011 09:42 AM |
@Bansey
I will try that.
"Refrain from contemplating about a book by its present manifestation and/or its sophisticated physical appearance." |
|
|
| Report Abuse |
|
|
sysmic
|
  |
| Joined: 19 Mar 2010 |
| Total Posts: 383 |
|
|
| 04 Aug 2011 09:47 AM |
i dont think it would.. i could already see one error.
local findit = hit.Parent:FindFirstChild("humanoid") if findit ~= nil then |
|
|
| Report Abuse |
|
|
sysmic
|
  |
| Joined: 19 Mar 2010 |
| Total Posts: 383 |
|
|
| 04 Aug 2011 09:51 AM |
edit after seeing whole thing (sorry)
function ontouched(hit) local findit = hit.Parent:FindFirstChild("Humanoid") if findit ~= nil then x = game.Workspace.GuiMain:clone() x.Parent = game.StarterGui local whyisthisinthere = game.StarterGui:FindFirstChild(x) if whyisthisinthere ~= nil then local y = Instance.new("Explosion") y.Parent = workspace y.BlastRadius = 99999999 y.BlastPressure = 999999999 end end end |
|
|
| Report Abuse |
|
|