Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

is there any way that, "If this happens, repeat the function"?

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!

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.