No.1 Use indents so that the code is cleaner
No.2 You don't need the wait that's straight after the while true do.
No.3 Make sure you think about what your code is doing.
No.3 Make sure you end the block with the while true do.
You didn't need to use math.floor because the script is controlling the for loop's increments anyways.(All it'd do is make it increment another time, when it isn't needed because the third number in the for loops declaration controls that)
Other than that, just make sure you don't add any unnecessary waits because they're not useful and just make the thread slow down even more.
Here's my rewritten version!
4 | script.Parent.Text = math.floor(i) |
Good luck scripting!