Its a bit confusing
A parameter is a special instance that a function could have. For example:
local Players = game.Players Players.PlayerAdded:Connect(function(Player) print(Player.Name) end)
In the code above it will print the name of any player that joins the server. The parameter can be named whatever but in the player added event it will always be the player that is added. You can try the script out for yourself if you want to play around with it. Second Example:
local Part = script.Parent Part.Touched:Connect(funtion(Hit) Hit.BrickColor = BrickColor.Random() end)
In the example above Hit is the part that touches the scripts Parent. You can always check if a function has a parameter by looking at the object browser in the view menu.
Below is an example: ``` game.Players.PlayerAdded:Connect(function(player)
``` In the example above, 'player' is the player that joins the game.
If we wanted to use the parameter to print the player's name then we would do the following. ``` game.Players.PlayerAdded:Connect(function(player) print(player.Name)
``` The above script would print the player's name into the output
'player' could also be called plr, it doesn't matter. However remember that we would have to say the following:
game.Players.PlayerAdded:Connect(function(plr)
print(plr.Name)