So Im new to scripting I barely know anything so when I want to do or learn things I go and find a tutorial. I was following along this tutorial https://youtu.be/6C9-Hud4UiY but my function did not run and it had no errors. So I added prints to find where it stopped working and it just stops working when it comes to function I tried everything that came into my mind but couldn't find a soliton could you guys help me?
Heres The Code: https://pastebin.com/JTUYh0vL
It stops working when it comes to line 23
You called the function on the wrong thread. The function can't be called because you called the function in the function, so it couldn't even run. You have to call the function outside of the function.
I also noticed that you are using wait()
and spawn()
. Try using task.wait()
and task.spawn()
instead, as they are more performant than the others. task.wait()
and task.spawn()
are a part of a library called the task library, which are more performant than their counterparts outside of the task library.