is there any way that, "If this happens, repeat the function"?
COMMUNITY QUESTION
is there any way that, "If this happens, repeat the function"?
1 answer
Yeah, you could do something like this:
local function printMsg()
print("Hello!")
end
printMsg() -- calls on function to execute
if #game.Players:GetPlayers() > 0 then -- if number of players is greater than 0
printMsg() -- calls function again
end
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You can even call the function again from inside the function itself if you need to.