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: Can you pass an argument through a Click Detector Function?

Previous Thread :: Next Thread 
babymariobebe is online. babymariobebe
Joined: 17 Jan 2012
Total Posts: 47
30 Jul 2017 08:43 PM
Can you pass an argument through a Click Detector Function?




Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
30 Jul 2017 08:44 PM
An argument is passed automatically by MouseClick.


Report Abuse
babymariobebe is online. babymariobebe
Joined: 17 Jan 2012
Total Posts: 47
30 Jul 2017 08:46 PM
Can you add one to it though? I need to add a number value but I dont know if it is possible with click detect mouseclick function


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
30 Jul 2017 08:46 PM
I can't imagine why you would need to. What purpose does the number serve?


Report Abuse
PuddyTats is not online. PuddyTats
Joined: 03 Apr 2008
Total Posts: 79351
30 Jul 2017 08:47 PM
if you want to use custom events, there's BindableEvent / RemoteEvent for that. You can't (or shouldn't, idk if you actually can) just fire off your own MouseClick event so there'd be no way to pass data through it.


-
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
30 Jul 2017 08:48 PM
I don't think so. You can get the player through MouseClick(player) though.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
30 Jul 2017 08:49 PM
Again, you shouldn't need to. The number should be able to be inherited into the function.


Report Abuse
PuddyTats is not online. PuddyTats
Joined: 03 Apr 2008
Total Posts: 79351
30 Jul 2017 08:52 PM
There's probably some purpose for a number somewhere. Some use case. Idk.

Like, if I'm keeping track of IDs with my click detectors and I want this guy to be known as some specific ID for anyone receiving the events, I want them to get that ID.
But then you'd use a BindableEvent for that


-
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
30 Jul 2017 08:53 PM
What's wrong with using a table?


Report Abuse
PuddyTats is not online. PuddyTats
Joined: 03 Apr 2008
Total Posts: 79351
30 Jul 2017 08:55 PM
Depends where you want to be catching the events.

If you want one script to basically be controlling IDs and different ones to be catching the events, you could use a module for it (depending how you built up all your other stuff) or just use a BindableEvent for it

Then other stuff just basically has to know the BindableEvent exists. Doesn't need to know the code exists, the module or script or whatever exists, ...
Which is probably cleaner in some cases. Depending on use case.


-
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
30 Jul 2017 08:57 PM
Okay, that's different. I wasn't thinking of it that way.


Report Abuse
babymariobebe is online. babymariobebe
Joined: 17 Jan 2012
Total Posts: 47
30 Jul 2017 09:13 PM
NVM I found myself a fix.


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