Rent region

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Tweakzz

Member
Feb 8, 2021
2
0
1
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?
 
Status
Not open for further replies.