Answered by
6 years ago Edited 6 years ago
Your issue is one of scope. The function is defined locally inside of a block of code. This means that your code will only see that function inside of the block that it was defined in. Here is my best explanation of scope. I don't know what you're trying to do, but because you have the :GetPlayerFromCharacter()
you don't need it inside the PlayerAdded
event. In fact, you are just creating additional unnecessary events every time a new player joins. I recommend putting the function outside of the PlayerAdded
event. I hope this helps and have a great day scripting! Note: read the link I posted to more clearly understand how scope works.