Jump between lines of code

I’m wondering if there’s a way with which you can jump to a certain line in the code.

I kinda messed up with my round script and made it really long instead of separating it into several scripts that get triggered by events.

The reason being, I started checking for players that left, and making sure the code doesnt bug out when theres a few players missing. To do this I have to jump the code to a winning screen or a draw screen which are at the end of my round script.

Is there any way to jump to the lines at the end?

Not really, but there’s something called spawn() that lets you run threads or functions in the background without yielding the entire script

1 Like

Ah, sad. Guess I’ll make the win and draw separate scripts and trigger them from the round script. Thanks for the information!

1 Like

you could also just create the winning function from the beginning of the script then use it when theres a few players missing.

1 Like

Yes, I see! I could use task.spawn and continously check if there are enough players. Thanks man! Or as you suggested, call the function when enough players are missing. I’ll see which one gives me better results

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.