Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can you define a specific parameters?

Asked by
nachsor 36
5 years ago

Does Anyone know if it is possible to set a value to be in a specific spot for a parameter? Like, if I make a function called "PrintMeMessage" and have 2 params, one for the text and one for how many times to say the message, is there a way to only give how many times to repeat it?

1 answer

Log in to vote
0
Answered by
bjr29 40
5 years ago
Edited 5 years ago

Use can use for loops for this.

function PrintMeMessage(message, amount)
    for i = 1, amount do
    print(message)
    end
end

PrintMeMessage("Hello World", 5)
0
I just used that as an example. Sorry for that. nachsor 36 — 4y
Ad

Answer this question