Ad
Log in to vote
-1

What is the lua version of function update?

Asked by 9 months ago

I come straight from c# and java where you have

``void Update() {

}``

and

``function Update () {

}``

That will constantly run all the code inside.

I made a script in the server script storage and am trying to check if there are players in a team or not with a simple if-statement.

It doesn't seem like the code is running again- only once at the beginning of the game (unless my code is wrong).

So my question is, how can I continuously run my code throughout the entire game?

1
You could use a "While true do" loop to constantly run whatever is inside of it. Make sure you have some sort of "wait()" in it so it won't try to run an infinite number of times at once. Whoami102 1 — 9mo
0
That's a great idea! Thanks! pick1ehead 53 — 9mo

Answer this question