Skip to content

Getting started | Yielding methods

Andrzej edited this page Jun 4, 2025 · 2 revisions

What are yielding methods?

These allow your script to "wait" for a certain amount of time, allowing you to delay certain actions, instead of running everything at once.

How to find them?

Very simple! The shelp methods command has a category called Yielding, where you can find yielding methods.

Note

There are some methods that are yielding, but are not in the category e.g. the RunScriptAndWait method.

How to use them?

The Wait method

The simplest there is, its only argument is duration, meaning for how long should the script wait.

# Waits for 5 seconds
Wait 5s

# Waits for half a second
Wait 0.5s

# Waits for 15 milliseconds
Wait 15ms

# Waits for 5 minutes
Wait 5m

# Waits for half an hour
Wait .5h

The WaitUntil method

This is a much more advanced method, which will wait until a certain condition evaluates to true.

# Waits until the method {RoundInfo hasEnded} will return true, meaning the end of a round
WaitUntil ({RoundInfo hasEnded} == true)

# Waits until the method {AmountOf @scpPlayers} will return 0, meaning 0 alive SCPs
WaitUntil ({AmountOf @scpPlayers} == 0)

Note

WaitUntil method uses conditions and value returning methods, which will be covered later down the tutorial series. This is just an example of what's possible.

Clone this wiki locally