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

Could somebody please give me some help with the topic Parameters & Arguments ?

because i really do not understand it and it's the only thing in roblox studio that i have learnt so far , do not understand and i want to do something a bit like this code:

function addition(number1,number2) print (number1+number2) end

addition(3,4)

so that is what i want to do and if you reply please make it simple to read because i only know a handful of stuff about roblox studio and if you can can you please give me some beginner tips

thanks

5 comments

0

uhh :FindFirstChild(Arguments) and local function randomfunction(Parameters)

0

could you explain that in sipler form please as i am only a beginner?

0

*simpler

0

Ummm what I suggest is searching up Roblox education and going through that series thing it helps it is step by step so do that.

0

how i can only find how to make a story game

1 answer

✓ Accepted answer

so basically a Parameter or an Argument is what's inside the two () of a function

so like

function functionName(argument1, argument2)
	--argument1 and 2 can only be used inside this function
end
function functionName(argument1)
	--Argument 1 can be used here
end

--But not here

So think of it like this...

A person1 (the function caller) wants person2 (the function) to do a simple addition something...But function 2 wants numbers (the arguments) first before doing the addition...Person1 gave (passed) him 5 and 2, so person2 did 5 + 2 and gave *(returned) *him the answer...

so in lua it would look like this

function add(a, b)
	return a + b
end

print(add(5, 2))

I know it's confusing... But the simplest way I could explain arguments or parameters is that it's what a function needs

Edit: If you have questions, feel free to ask them

3 comments

0

ok that expll[ination was really clear thanks for that!

0

welcome!

0

no questions needed!

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