Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's the point of the () in :LoadCharacter()?

Asked by
Mr_Unlucky 1085 Moderation Voter
5 years ago
game.Players.Mr_Unlucky:LoadCharacter() --What's the point of the () in :LoadCharacter()?
0
That calls the method. User#19524 175 — 5y

2 answers

Log in to vote
3
Answered by
piRadians 297 Moderation Voter
5 years ago
Edited 5 years ago

Every function has these, it is so when you call it, you can pass arguments.

0
They're arguments, not parameters, but you've got the right idea. Parameters are a function's input variables. Arguments are values passed to a function during a function call, and which *get assigned to* parameters. Link150 1355 — 5y
0
So, basically when defining the function, you have parameters... hmmm piRadians 297 — 5y
0
Yes, parameters appear in the parentheses of a function definition, not a function call. e.g, `function add(a, b) return a+b end`. `a` and `b` in this example are parameters, whereas `2` and `3` in `local sum = add(2, 3)` are arguments. Link150 1355 — 5y
0
Thanks for explaining. piRadians 297 — 5y
Ad
Log in to vote
-3
Answered by
angeI1001 123
5 years ago

That's pretty much just how it works...

Hope this helped you.

0
Think of it like this: local new_obj = Instance.new("Part",workspace) -- You see you may need to put arguments in it. namespace25 594 — 5y

Answer this question