|
| 30 Jul 2017 08:43 PM |
Can you pass an argument through a Click Detector Function?
|
|
|
| Report Abuse |
|
|
|
| 30 Jul 2017 08:44 PM |
An argument is passed automatically by MouseClick.
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 30 Jul 2017 08:46 PM |
I can't imagine why you would need to. What purpose does the number serve?
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 30 Jul 2017 08:48 PM |
| I don't think so. You can get the player through MouseClick(player) though. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 30 Jul 2017 08:53 PM |
What's wrong with using a table?
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 30 Jul 2017 08:57 PM |
Okay, that's different. I wasn't thinking of it that way.
|
|
|
| Report Abuse |
|
|
| |
|