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

What do the double parenthesis without anything inside do and why do people use them?

This may seem like a dumb question but, what do the double parenthesis without anything inside exactly do? I've seen them quite often, though I'm still not too sure of what their purpose is. The internet doesn't exactly give specific answers. e.g.

local function addNumbers()

1 comment

0

Parameters are supposed to go inside double parenthesis.

2 answers

✓ Accepted answer

when your defining a function, you'll often specify arguments that will be passed when the function is called. the parameters are set in the parenthesis..

for instance:

function addNumbers(numberA, numberB)
	return numberA + numberB
end

local result = addNumbers(1,2)
print(result)

or

function sayHello()
	print("Hello there")
end
sayHello()

or

function greet(personsName)
	print("Hello, "..personsName)
end
greet("JustPhysical")

learn more here

Parameters are left blank usually for simple functions. However, you will see parameters in the double brackets in more complex functions. Events(or most, I'm not sure) will give a parameter depending on the event (ex. a touched event provides the part that touched the block)

In conclusion, empty brackets are not commonly found in functions, but they do exist.

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