So i'm trying to make a skript where player's can rent a region/plot when they right click a sign.
And for now i have this.
on sign change:
if line 1 is "[rent]":
set line 1 to "&5[rent]"
send "{@logo} Plot updated!"
on right click on sign:
if line 1 is "&5[rent]":
if line 3 parsed as integer is set:
set {_date} to "%line 4%" parsed as timespan
if {_date} is set: #replaced "if ("%line-4% parsed ...) is set:
if balance of player > line 3 parsed as integer:
set {rent.%uuid of player%.time} to now
set {rent.%uuid of player%.duration} to {_date}
send "{@logo} You rented a Plot"
execute console command "rg addowner -n %line 2% %uuid of player% -w %world of player%"
remove (line 3 parsed as an integer) from balance of player
wait "{rent.%uuid of player%.duration} seconds" parsed as timespan
make console execute command "/rg removeowner %{_region}% %uuid of player% -w %world of player%"
And it works, but if i rent a region for like 1 hour and i reset the server the player would be the owner of the region for ever.
How can i make it so the rent thing stay's even if the server reloads/restarts?
And for now i have this.
on sign change:
if line 1 is "[rent]":
set line 1 to "&5[rent]"
send "{@logo} Plot updated!"
on right click on sign:
if line 1 is "&5[rent]":
if line 3 parsed as integer is set:
set {_date} to "%line 4%" parsed as timespan
if {_date} is set: #replaced "if ("%line-4% parsed ...) is set:
if balance of player > line 3 parsed as integer:
set {rent.%uuid of player%.time} to now
set {rent.%uuid of player%.duration} to {_date}
send "{@logo} You rented a Plot"
execute console command "rg addowner -n %line 2% %uuid of player% -w %world of player%"
remove (line 3 parsed as an integer) from balance of player
wait "{rent.%uuid of player%.duration} seconds" parsed as timespan
make console execute command "/rg removeowner %{_region}% %uuid of player% -w %world of player%"
And it works, but if i rent a region for like 1 hour and i reset the server the player would be the owner of the region for ever.
How can i make it so the rent thing stay's even if the server reloads/restarts?