Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with conventions?

Alright so im making a few very broad functions for my game to use and i am giving them quite a lot of parameters 5 - 6 each so first is this an ok convention and second off if i dont want to pass a parameter is it ok to call a function like this

myFunction(parameterA,    , parameterC)

doing this as so the second parameter is not passed

1 answer

✓ Accepted answer

Depending on the function, you may want to consider using a single table parameter instead of a ton of parameters that may or may not be passed.

As for your function call, you'll have to explicitly put nil in place of blank arguments when they are not at the end of the arguments.

2 comments

0

ok so the call would look like myFunction(parameterA, nil, parameterC)

0

Yes.

This discussion is preserved as it was. New answers, comments, and votes are closed.