0

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

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?

Example:

local function placeBarrier(barrierNumber, barrierPlace)


I would really like to know what those mean.

6
Ziffixture 6785
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)
end

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.

0
Thanks! Abysmallow 1 — 1y