Arguments are the variables created by functions. Parameters are the definitions of those variables. In methods like FindFirstChild(), you only have to type in the Instance parameter (and, if you want, the boolean recursive parameter). Example:
if game.Workspace:FindFirstChild("Part") ~= nil then
print("part found")
end
"Part", the string put in as the parameter to the Instance argument, defines Instance as a Part in the Workspace. All methods require you to fill in just a parameter.
Functions
Functions are a bit different from methods. Functions require you (if you want) to give it an argument AND fill in a parameter for that argument. Example:
function Roblox(oof)
print(oof)
end
Roblox("oof")
The tricky thing with parameters to function arguments is that they can be any value possible. In the function Roblox(), the argument "oof" was defined by the parameter "oof" (a string). Most parameters define the arguments outside the functions.
Exceptions?
The most talked-about exception to being defined outside the function is defining it inside the function. This is not possible. You can spread the argument around the function however you want, but if you want a parameter for it that parameter must be outside the function. Example:
function Round(num, addend)
return math.floor(num + addend)
end
Round(6.5, 0.5)
This function uses the two arguments it produced and sets them as nil until the parameters are set for them. In this case, we are rounding 6.5 to 7 by "tricking" math.floor(). If you have any questions, please ask them.
Thanks,
MCAndRobloxUnited
5 comments
You have them confused. Arguments are what you pass to the function call. Parameters are in the definition of the function
read the lua manual
you rely too much on the wiki
don't forget basic lua and roblox lua may be the same language, it still has a few difference, and the naming in roblox might be one, I agree with sjr04Alt on this (even though this would still be correct)
parameters are also defined even without a fill-in (e.g. player added)