Help With Parameters

Well, if something similar needs to be done for many different values, parameters and arguments are useful. For example, if you had a rounding function for rounding the result of a calculation, you don’t know the result of that calculation before that calculation is made. You need to give the function the result of that calculation each time you do the calculation and call the rounding function and the result of that calculation could be different each time.

The Roblox API functions use parameters too. For example, Instance.new takes a classname as an argument, so that classname is then set as the value of some parameter. The function uses that information so that it’ll create an Instance object of the correct class everytime it’s called.

Shortly, parameters are useful when you need to do something many times with different values.

3 Likes