The parenthesis are variables for values. These are defined when you call the function. This is typically when you want the function to use the value and manipulate them in your favor.
function Add(x, y)
return x + y
end
print(Add(5, 11))
In the script above, the variables of x and y take the place of the values 5 and 11 used in the call on line 5. The function should return the intended result 16. You can also call functions using instances, bools, tables, et cetera.
When you're using an event, the event will automatically get the value for you. All you would have to do is set it as a variable in your function. So if Player1 joins your game and you have a PlayerAdded event listening, the script will automatically get the player who joined.
function PlayerAdded(Player)
print(Player.Name)
end
game.Players.PlayerAdded:connect(PlayerAdded)
You would want to look through the wiki and find what events will return what values and learn how to manipulate functions in your favor.
######Hopefully this answered your question. If so do not forget to hit the accept answer button. If you have any questions, feel free to comment below.
2 comments
You'll find this page quite informative, in particular the part about arguments and parameters: http://wiki.roblox.com/index.php?title=Function
Try a video I made on functions: https://www.youtube.com/watch?v=XwAxFAc21Xs