I am making a script currently, and it has debounce, but I don't want the script to run again. How would I make it so it's infinity?
Use a while loop, which runs a code an infinite amount of times unless you use "break" etc.
while true do --code wait() --I would put a wait at the end of every loop in case it doesnt crash. end
As long as you don't write in any loops or connect any functions to repeatable events, the code inside a Lua will only execute once every time it is made un-Disabled (including when the game first loads).
You don't need to add any sort of wait to the end of it.
If you want to escape an infinite loop, use the break
keyword.
If you want to escape a function, use the return
keyword.