Do every (Number attribute) seconde . who change during the game Hellp pleaze

YobKgames

  • Posts: 63
i wanna use the loop do every ...seconde with an number attribute
but the the loop apply only the initial value of number attribute after a few time I say that the number attribute change it change but the changing does not apply to the loop ..... Any solution helppp pleaaaaze
the idea its to do think everey 1 seconde and after a few time do it every 2 seconde and after time do it everey 3 seconde ...ect the value of the loop channge

designpeg

  • *
  • Posts: 731
I'd use an event block, then let that event trigger itself after the period you want with a do after [period value] seconds block.  The period value could be set via a game attribute.

You could also include a boolean so that you could stop it triggering when you want

YobKgames

  • Posts: 63
can you give me an examplee pleaaaaaaze

designpeg

  • *
  • Posts: 731
Hi, I've attached a screen shot, hopefully, it's clear enough.
If you need to stop the timer put the trigger event block within the do after inside an if block, and creat an attribute called timer running or something, of maybe if doEvery > 0, then you could set the interval to zero to stop it.

Once stopped, you need to call it with a trigger event to start it looping again

YobKgames

  • Posts: 63
okey i never used before this technic so can you explain to me  the operation of the bloc trigger

in the trigger bloc . event  present what ?  and in behaviour present what ? help me pleaze and in your screen shot in behaiviour you put repeat every ? this present what ?

excuse me for my bad english and thnks for your help

LIBERADO

  • *
  • Posts: 2720
okey i never used before this technic so can you explain to me  the operation of the bloc trigger
More info: http://www.stencyl.com/help/view/custom-events/
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

YobKgames

  • Posts: 63
in beahaiviour what does it mean i dont understand ? it present what ? im suppose to write what in it ?

LIBERADO

  • *
  • Posts: 2720
You can replace that block with this one:
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

YobKgames

  • Posts: 63
aahh it"s more cleaar thankss for your help