some general improvements you can make yourself:
- Follow the Roblox Lua Style guide
- Use // instead of
math.floor
Example:
print(5 // 2) --output: 2
-
if Paused.Value == true then
you can put a boolean directly instead of checking if it equals true or false. Example:if Paused.Value then
- Use guard clauses
- Reduce code nesting: https://www.youtube.com/watch?v=CFRhGnuXG-4
- PSA: Don't use Instance.new() with parent argument
You can also test your luck with AI to simplify, but it can spew nonsense most of the time.
Also don’t put everything into one script lol