• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua how to double the line and increase the number

Enderlop

Banned User
Joined
Jan 10, 2024
Messages
93
Reaction score
16
how to double the line and increase the number
example:

<instant name="Super" words="0" lvl="25" mana="90" exhaustion="2000" script="attack/samuel0.lua">
<vocation id="3;2;4;7;6;8"/>
</instant>
<instant name="Super" words="1" lvl="25" mana="90" exhaustion="2000" script="attack/samuel1.lua">
<vocation id="3;2;4;7;6;8"/>
</instant>
<instant name="Super" words="2" lvl="25" mana="90" exhaustion="2000" script="attack/samuel2.lua">
<vocation id="3;2;4;7;6;8"/>
</instant>
<instant name="Super" words="3" lvl="25" mana="90" exhaustion="2000" script="attack/samuel3.lua">
<vocation id="3;2;4;7;6;8"/>
</instant>
<instant name="Super" words="4" lvl="25" mana="90" exhaustion="2000" script="attack/samuel4.lua">
<vocation id="3;2;4;7;6;8"/>
</instant>

300 line max
 
Solution
Lua:
for i = 0, 300 do
    local scriptNumber = i  -- Start with 0 and increase by 1 each iteration
    print(string.format('<instant name="Super" words="%d" lvl="25" mana="90" exhaustion="2000" script="attack/samuel%d.lua">', scriptNumber, scriptNumber))
    print('    <vocation id="3;2;4;7;6;8"/>')
    print('</instant>')
end
Lua:
for i = 0, 300 do
    local scriptNumber = i  -- Start with 0 and increase by 1 each iteration
    print(string.format('<instant name="Super" words="%d" lvl="25" mana="90" exhaustion="2000" script="attack/samuel%d.lua">', scriptNumber, scriptNumber))
    print('    <vocation id="3;2;4;7;6;8"/>')
    print('</instant>')
end
 
Solution
Back
Top