Log in to vote

What does the things between the parentheses mean? (Solved)

Asked by 1 year ago
Edited 1 year ago

This might sound stupid, but I am a beginner developer and don't know what these things mean, can somebody help?


local function placeBarrier(barrierNumber, barrierPlace)

I would really like to know what those mean.

1 answer

Log in to vote
Answered by
Ziffixture 6785 Moderation Voter Community Moderator
1 year ago
Edited 1 year ago

Arguments & Parameters

This is what is formally known as a parameter. It is a specially declared variable within the function, that refers and contains information provided during the operation of said function.

The way we assign this data, is by supplying arguments. These are passed through the parentheses of the function when it is called. Here is a better visualization of how this process occurs:

local function multiply(numberOne, numberTwo)
    print(numberOne * numberTwo)

multiply(2,5) --> 10

This allows the function to take in specific data, and use it accordingly; your function would need to know where and what barrier to place, so it requires that you supply these parameters so it knows what to use.

Thanks! Abysmallow 1 — 1y

Answer this question