|
| 20 Jan 2012 04:54 PM |
I am wondering how I could make a part show a GUI. Here is probably how it would work
-Click Detector in the part
function openup()
script.Parent.Parent.Parent.StarterGUI.ScreenGUI.Frame.Visible = true end
script.Parent.MouseButton1Down:connect(openup)
Would that work? Just to confirm. |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 04:58 PM |
No. You would use the clickdetector mouseclick function, once activated, access the player's PlayerGui, then make it show it.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:04 PM |
So how would that work, something like?
gui = game.Lighting.clickedgui
function click()
gui:clone().Parent = player.PlayerGui wait() --to let the computer know it can take its time theGUI = game.Lighting.YOURGUINAME
end
script.Parent.Clicked:connect(click)
i really am not advanced with clicked stuff except MouseButton1Down |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:05 PM |
It's ok, just wait a sec to look for something.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:05 PM |
Scrap the line theGUI = game.Lighting.YOURGUINAME I actually meant script.Parent.Clicked:connect(click) but then i forgot an end so my mind wandered |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:09 PM |
Hm try:
p = game.Players.LocalPlayer
script.Parent.ClickDetector.MouseClick:connect(function() if p ~= nil then p:FindFirstChild("StarterGui").ScreenGui.Frame.Visible = true end end)
?
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:18 PM |
MouseClick now has an argument to get the player, i haven't used it yet, but i think it just works like this:
script.Parent.ClickDetector.MouseClick:connect(function(p) if p ~= nil then p:FindFirstChild("StarterGui").ScreenGui.Frame.Visible = true end end)
~I've been to nil and back. |
|
|
| Report Abuse |
|
|