i already looked it up on roblox wiki, but i was wondering if you could give me an example and a more simple definition of it
COMMUNITY QUESTION
can someone explain to me and give an example of an argument being used?
1 answer
An argument, also known as a parameter, is used in functions when you want to use a variable in a function, usually because you don't know exactly what you want to do or you don't know what you are performing the action. For example, say I had a function to change the BrickColor of a part:
function changeBrickColor(part, newColor)
part.BrickColor = newColor
end
'part' and 'newColor' are the arguments, because they tell us which part to change the BrickColor of, and what to change it to. We would then call the function like so:
changeBrickColor(Workspace.Part, BrickColor.new('Really red'))
Which would change the BrickColor of Workspace.Part to 'Really red'.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
thank you, I think i understand it a little bit more