A friend of mine made a gun script, In his line of code I noticed that one of the variables doesn't have a value assigned to it (Character)
local Player = Players.LocalPlayer local Character local Mouse = Player:GetMouse()
The script works, there's no doubt about that, but why? What does the character variable equal, and if it doesn't equal anything, why put it there in the first place?
Not assigning a value to variable within a statement makes that statement a Declaration statement, instead of a Initialization statement.
Declaring a variable just means you create a new variable that may or may not be used later on, and declaring it early means you can use it anywhere in the script as needed.