|
| 16 Feb 2015 09:23 PM |
function onClicked(P) if script.Parent.ClickDetector.MouseClick == true then game.Part1.SurfaceGui.Frame.Visible = true else if script.Parent.ClickDetector.MouseClick == true then game.Part1.SurfaceGui.Frame.Visible = false end end script.Parent.ClickDetector.MouseClick:connect()
SadForMySad |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:24 PM |
No, you never call onClicked.
Also anonymous function way is much prettier, and btw "p" is a dumb argument name.
script.Parent.ClickDetector.MouseClick:connect(function(player) ---code end)
also "if script.Parent.ClickDetector.MouseClick == true" um what |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:26 PM |
I assume you want it to toggle the visibility of the frame when the ClickDetector is clicked:
function onClicked() game.Part1.SurfaceGui.Frame.Visible = not game.Part1.SurfaceGui.Frame.Visible end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:26 PM |
Yeah, click detections confuse me, if you click the brick that has the click detector, it's supposed to make the Surface GUI's frame visible and not visible.
SadForMySad |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:30 PM |
So, does that make it to where if you click it 2 times the Frame will disappear?
SadForMySad |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Feb 2015 09:33 PM |
If I got more questions, I'll ask you. Since the Frame will involve sounds, and stuff like that. Is it possible to where you could tween the Surface GUI's frame into a certain position that I want it to? I have no idea how to tween, so this might be hard for me to explain.
SadForMySad |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:35 PM |
it says, Part1 is not a valid member of DataModel?
SadForMySad |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Feb 2015 09:37 PM |
game.Workspace fixed it.
SadForMySad |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:39 PM |
Alright so, I would need a TextButton to play sounds right?
SadForMySad |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:56 PM |
Ok, I got a question, what would I do to stop any sounds from playing if a sound is already playing?
SadForMySad |
|
|
| Report Abuse |
|
|