#functions runs several times when called once

27 messages · Page 1 of 1 (latest)

lime jay
#

the first time the dev product is purchased, it works and only spawns one noob. the second time it spawns two. third time it spawns 4. so each time it doubles, why?

twilit creek
#

ok

#

read ur code

#

what happens when you trigger it?

#

you connect a callback function to PromptProductPurchaseFinished

#

alright

#

so when you trigger it

#

two times

#

you connect to callback functions

#

when you trigger it a third

#

you connect three

#

...

#

i hope u understood

lime jay
#

i do but why does it account for all the previous times you finished the prompt as well

lost cypress
#

But never disconnect it

#

So it’s connected multiple times

#

And thus runs N times for N triggers

#

Do :Once instead

twilit creek
#

he can just move it out

lime jay
#

ah

dusk trailBOT
#

studio** You are now Level 3! **studio

lime jay
#

let me try

twilit creek
lost cypress
#

Didn’t realize that’s a promptfinisihed connection

lime jay
#

alright thanks before i figured i didnt have to disconnect it because each time it was triggered the function is reset