It’s fine, would be hard to access that variable if it was defined inside the function…
In both instances of code plr is referencing LocalPlayer.Character. I understand it’s against usual naming conventions, but functionally still works. The issue is due to the code running before the Character is actually created and code snippet 1 by @dizzyscobbyScripting was almost right but not quite there.
If i label the character with the or statement plr.Character or plr.CharacterAdded there are no answers for plr.Character and plr.CharacterAdded is just labeled as an RBXScriptSignal. What exactly am i supposed to do with this?
when you set the char variable to plr.Character or plr.CharacterAdded:Wait() it sets the variable to plr.Character first and if it fails because the character is not loaded yet, it would use plr.CharacterAdded:Wait() as a backup and yield it until the character is loaded.