Can someone explain them to me I dont get them. Thanks
✓ ANSWER ACCEPTED
What are parameter and what do they do?
1 answer
✓ Accepted answer
Parameters are basically things you can add as sort of local variables for a function you run. For example:
function a(text)
print("Function A was run with the parameter: "..text)
end
a("This is a parameter!")
Another example is like when you have an event for something (such as a Touched event on a part)
--This function automatically has a parameter that is run through it with any name that you can set for it. It is the part that touched (in this example) script.Parent
function touch(Part)
print("Part: "..Part.Name.." touched "..script.Parent.Name.."!")
end
script.Parent.Touched:connect(touch)
But if you try to use a parameter outside of a function it will error saying this doesn't exist
function b(text)
print("Function B was run with the parameter: "..text)
end
print(text)
b("This is a parameter!")
--This will error out saying 'text' is a nil value
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Your answer is slightly inaccurate. Function (and by extension methods) accept arguments to fillparameters. Parameters are effectively local variables, but what you pass in is an argument. The Touched event, for example, calls any listening (aka connected) function with the part that Touched it passed in as an argument, to the 'Part' parameter in your function.