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 » Scripters
Home Search
 

Re: Does this work?

Previous Thread :: Next Thread 
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
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
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
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
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
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
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
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
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
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
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
16 Feb 2015 09:31 PM
It should.
Report Abuse
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
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
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
16 Feb 2015 09:35 PM
it says, Part1 is not a valid member of DataModel?

SadForMySad
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
16 Feb 2015 09:37 PM
Try workspace.Part1
Report Abuse
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
16 Feb 2015 09:37 PM
game.Workspace fixed it.

SadForMySad
Report Abuse
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
16 Feb 2015 09:39 PM
Alright so, I would need a TextButton to play sounds right?

SadForMySad
Report Abuse
Exquisites is not online. Exquisites
Joined: 06 Apr 2014
Total Posts: 2732
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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