How would I make a script that only repeats a specific number of times?

I’m not sure how to elaborate further, but I just want, for example, a script that says

print("Hello World!")

17 times no more, no less.

You would use Loops

for i=1, 17 do
    print("Hello World!")
end

You should look into for loops specifically for this, though you can technically do it with any loop and some variables.

you could use a ‘for’ loop

for loopnamehere = 1, 17, 1 do
	print("Hello World!")
end

you read up about them more at https://education.roblox.com/en-us/resources/repeating-tasks-with-for-loops