i click the button the first time it works, i click it the second time it fires twice, (for a total of 3 fires for 2 clicks) I click it a third time it then fires three times (for a total of 6 fires and 3 clicks) I don't have any idea why. Im also getting this error msg but its still subtracting the vlaues and stuff
#bind event fires twice on the second click and three times on the third what is wrong?
1 messages · Page 1 of 1 (latest)
Theres something called bindablefunction tho
Every time you click, you make a new connection. So you're connecting many times to the same event.
That’s what I’m told but I don’t see how it’s better than what I’m doing (I prob wrong so pls enlighten me)
** You are now Level 10! **
How I fix that?
Is bindable function 1 connection?
if I use a bindable function then i cant use the same bindable function when I need to invoke something else like I can with a bindable event
using a bindable function will make me using 11 others and doing 11 different functions for a simple subtraction of coins
So how i fix without that
wait
i think i got that wrong
You need to be using a BindableFunction.
You're firing an event and immediately connecting to it so you can get the result. That's what a BindableFunction is for. It returns a result.
If you want to keep your system, just change Connect to Once on the event in the mouse click.
but I didnt know that bindable functions invokes can be caught by the same script
Once disconnects itself after the first firing.
They can. But if one script is calling the function and responding, then you should be using normal functions.
but i want to click the button multiple times
yeah ik but im trying to invoke something to a different script but the same script is catching it in a different place that im using oninvoke
~~use ProximityPrompt.Trigged:Connect(function() ~~
the clicking of the button is fine if that is what its for (if its not pls follow up)
oh wait its a button
use :once()