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
6 years ago
game.Players.Mr_Unlucky:LoadCharacter() --What's the point of the () in :LoadCharacter()?
0
That calls the method. User#19524 175 — 6y

2 answers

Log in to vote
3
Answered by
piRadians 297 Moderation Voter
6 years ago
Edited 6 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 — 6y
0
So, basically when defining the function, you have parameters... hmmm piRadians 297 — 6y
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 — 6y
0
Thanks for explaining. piRadians 297 — 6y
Ad
Log in to vote
-3
Answered by
angeI1001 123
6 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 — 6y

Answer this question