|
| 12 Nov 2011 12:24 PM |
onClick it opens onClick again it closes
How to make it like that? This is the script that needs to do the function above:
function onClicked(GUI) h = script.Parent.Parent.Parent.Parent.Parent.Character:findFirstChild("Humanoid") if (h ~= nil) then script.Parent.Parent.Parent.Frame.Visible = true else return end end script.Parent.MouseButton1Click:connect(onClicked)
Thank you. |
|
|
| Report Abuse |
|
|
| |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
|
| 12 Nov 2011 12:28 PM |
Like this?
function onClicked(GUI) h = script.Parent.Parent.Parent.Parent.Parent.Character:findFirstChild("Humanoid") if (h ~= nil) then script.Parent.Parent.Parent.Frame.Visible = true elseif script.Parent.Parent.Parent.Frame.Visible = false end end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 12 Nov 2011 12:29 PM |
Um... You could make an active value, so if it's active and someones clicks it it is not active, and vice versa.
and make another script telling it what to do when it's active/ not active. |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|