Log in to vote

What is the lua version of function update?

Asked by 3 months ago

I come straight from c# and java where you have

``void Update() {



``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?

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 0 — 3mo
That's a great idea! Thanks! pick1ehead 1 — 3mo

Answer this question