okay for question #1 This will work.... its just multiplying 5 by the loop value (which is the number of the loop)
code_language.skript:
command /try:
trigger:
loop 5 times:
wait 1 second
set {_perc} to 5 * loop-value
broadcast "%{_perc}%%%"
For question #2 Skript has a built in rounding function
This will round up and down accordingly
depending how you are planning in using that in script, you could do something like
**This is just an unnecessary example, since 5 * something is already rounded, but just to give you an idea of how it would work
code_language.skript:
set {_perc} to round(5 * loop-value)
[doublepost=1534584634,1534584482][/doublepost]Heres another example:
So take the original one I sent you... and lets pretend we change 100 to 99
code_language.skript:
command /try:
trigger:
loop 5 times:
wait 1 second
set {_perc} to (99 / 5) * loop-value
broadcast "%{_perc}%%%"
the output would be as follows
code_language.skript:
[02:28:40 INFO]: 19.8%
[02:28:40 INFO]: 39.6%
[02:28:41 INFO]: 59.4%
[02:28:41 INFO]: 79.2%
[02:28:41 INFO]: 99%
but if we throw that function in there to round it
code_language.skript:
command /try:
trigger:
loop 5 times:
wait 5 ticks
set {_perc} to round((99 / 5) * loop-value)
broadcast "%{_perc}%%%"
the outcome would be as follows
code_language.skript:
[02:28:51 INFO]: 20%
[02:28:52 INFO]: 40%
[02:28:52 INFO]: 59%
[02:28:52 INFO]: 79%
[02:28:52 INFO]: 99%