Jump to content
theonlysnowflake

Timed Loop output

Recommended Posts

I am making a contraption that is sort of like pistons, and know how to make everything except a timer to keep them moving. I was thinking I could create a pivot to have an output (that I could manage in the FlowGraph editor), and just have it loop the output with a delay of about a second before it loops again.

 

To quickly summarize

  1. How to program an output that will be displayed in the FlowGraph editor
  2. How to loop it with a delay between outputs
  3. How to have it not stop until I want it to.

Thank you

Share this post


Link to post

Here is one second timer in a loop:

 

function Script:Start()
 lasttime=0
end

function Script:UpdateWorld()
 if Time:GetCurrent()-1000 >= lasttime
 then
   lasttime = Time:GetCurrent()
   System:Print("one second has just passed...")
 end
end

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...