World Delete Inactivity

  • 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 comminuty!

    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.

iJDuhb

Active Member
Mar 14, 2017
54
0
6
34
I am currently working on a player server skript and I want it do after 5 minutes of no players on the world it will delete it, And it wont delete the kitpvp and hub worlds.

Any help?
 
You should listen to the teleport event (or yet better, the world change event) and check how much players are in the past world, if there are no players, then wait 5 minutes, check if there are no players again and if so, check if the world wasn't hub or kitPvP and then delete the world. Be aware that this method will not work after a restart.
 
https://hastebin.com/hogopitodo.py

can't understand this condition: 'player's past world is {_pw}' (PlayerServers.sk, line 70: if player's past world is {_pw}:')
because that's not an expression but the past event-world is. Also, you can just use the amount of and entities in world expression for keep the track of how much entities are in a world, example:
code_language.skript:
if amount of players in world "world-1" is equal to 0:
    delete world "world-1"
 
Thanks, I was wondering if I could do that I'll test it tomorrow. :emoji_grinning:
[doublepost=1490996449,1490925419][/doublepost]] can't understand this condition: 'on world change' (PlayerServers.sk, line 64: on world change:')
5:39:56 PM [ERROR] Can't compare 'amount of players in world "world-1"' with an integer (PlayerServers.sk, line 65: if amount of players in world "world-1" is equal to 0:')
[doublepost=1491340174][/doublepost]can't understand this condition: 'on world change' (PlayerServers.sk, line 64: on world change:')
5:39:56 PM [ERROR] Can't compare 'amount of players in world "world-1"' with an integer (PlayerServers.sk, line 65: if amount of players in world "world-1" is equal to 0:')
 
Status
Not open for further replies.