i was friggin happy about this workaround until i found out it's not working for me if i call the function at the same time with different parameters.
i have multiple spaceships which spawn different bullets. they are called p1_ship, p2_ship, p3_ship and p1_bullet, 02 ...
i then have each bullets and ships in a family called all_ships and all_bullets.
all_bullets | on created -> function | call "cooldown" (all_bullets.player). - player is an instance variable which stores the player nomber to whom the bullet belongs
then:
+ local static text persist = " "
function | on "cooldown"
-> system | set persist to function.param(0)
-> [engine] | set value at (persist,1) to 1
-> system | wait [upgrades].At(persist,13),2,2) seconds
-> [engine] | set value at (persist,1) to 0
-> system | set persist to " "
where these are [arrays]
this works fine if everybody shoots at different times, but if all characters shoot together, only one of them will get his cooldown reset after the wait time.
i think this is because they all use the same local text variable when they call the function.
is this possible? could you think of a fix?
cheers! phil