Hello, So I'm trying to make a skript that will save an arena and load it. I need some help though. The first like a minute or two it works fine with 19.98 - 20 tps which is average for my server after a certain amount of time the TPS goes down a lot I mean like to 10TPS I don't want to use addons (At least try to don't use them) And I want it to load (Relatively) Big arena's
If i remove the delay's the server would just crash. I already thought about the placements of block im doing in the saveArena part but i dont know how to show the progress in a different way if the block placement is causing the issuse can someone tell me how to display the progress?
Thanks alot!
If you can optimize the code / Make it less laggy (Prevent qrazy TPS drops) i will be very happy!
EDIT: The {ww.pos1.%{_arena}%} are locations also there is a little thingy build in that will fill chest with items when loading arena again
I want to use this script for Resetting a map.
Code:
function saveArena(arena: text):
set {_speed} to 0
delete {revertlist.%{_arena}%::*}
set {_height} to {minh.ww.%{_arena}%}
loop ({maxh.ww.%{_arena}%} - {minh.ww.%{_arena}%}) times:
loop all blocks within block at {ww.pos1.%{_arena}%} and block at {ww.pos2.%{_arena}%}:
y-coord of loop-block is {_height}:
add type of loop-block to {revertlist.%{_arena}%::*}
add 1 to {_speed}
set loop-block to red stained glass
if {_speed} is higher than 75:
set {_speed} to 0
wait 5 tick
add 1 to {_height}
wait 5 seconds
revertArena("%{_arena}%")
function revertArena(arena: text):
set {_bla} to 0
set {_height} to {minh.ww.%{_arena}%}
loop ({maxh.ww.%{_arena}%} - {minh.ww.%{_arena}%}) times:
loop all blocks within block at {ww.pos1.%{_arena}%} and block at {ww.pos2.%{_arena}%}:
y-coord of loop-block is {_height}:
add 1 to {_bla}
set loop-block to {revertlist.%{_arena}%::%{_bla}%}
if {revertlist.%{_arena}%::%{_bla}%} is chest:
set slot 0 of loop-block to wooden sword
add 1 to {_height}
Thanks alot!
If you can optimize the code / Make it less laggy (Prevent qrazy TPS drops) i will be very happy!
EDIT: The {ww.pos1.%{_arena}%} are locations also there is a little thingy build in that will fill chest with items when loading arena again
I want to use this script for Resetting a map.