Announcement

Collapse
No announcement yet.

Wait statement?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wait statement?

    How would I make a script wait for 60 seconds until it runs again. I don't want it lagging the cpu by checking over and over. The sleep statement from Java didn't work.

    #2
    Sleep only works in state code, not inside functions.

    Comment


      #3
      You can always split the funciotn into two parts and set a timer for 60 seconds that then runs the second part

      Comment


        #4
        Or make a state especially for the purpose of waiting. You can call Sleep in state code.

        Comment


          #5
          Just be careful, state code makes spaghetti code very easily. Just look at the AI, lol. Not that it isnt useful, just be careful.

          Comment


            #6
            State code is wonderfull in some situations and horrible in others, plus it only works in actor based classes

            Comment

            Working...
            X