Jump to content

Timed Loop output


theonlysnowflake
 Share

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

Link to comment
Share on other sites

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

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...