Solved Help how to reset variable???

  • 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.

VojaFTW

Member
Jun 10, 2017
42
2
0
Hello, i coding some sort of event system but i'm stuck with problem how to reset variable {cc.event.%player%} becouse if player want to create event and past event is not removed correctly he can't create another and i'm also stuck with removing world files when player close event. when player close event only files is being rmeoved is levle.dat uid.dat and sesion.lock folders data playerdata and region with files in this folder is not removed also a world folder, sooo here is my code:

code_language.skript:
command /hostevent:
    permission: cc.command.hostevent
    permission message: &cInvalid permission, sorry.
    trigger:
        if {cc.event.%player%} is not set:
            send "&0[&3&l%{ePrefix}%&0] &3%player%'s Event-1 successfully created. You will be sent to it shortly."
            send "&0[&3&l%{ePrefix}%&0] &3If you haven't been send in 20 seconds, type /mv tp %player%'s Event-1"
            create folder "plugins/CamCraftCore/CCEvents/%player%'s Event-1"
            load world "plugins/CamCraftCore/CCEvents/%player%'s Event-1"
            wait 20 seconds
            teleport player to spawn of "plugins/CamCraftCore/CCEvents/%player%'s Event-1"
        else:
            send "&0[&3&l%{ePrefix}%&0] &3Your event is still being created or already exists. If you haven't been send in 20 seconds, type /mv tp %player%'s Event-1."
            
command /eventconfirm:
    permission: cc.command.eventconfirm
    permission message: &cInvalid permission, sorry.
    trigger:
        if {cc.event.%player%} is not set:
            send "&0[&3&l%{ePrefix}%&0] &3%player%'s Event-1 successfully created. You will be sent to it shortly."
            send "&0[&3&l%{ePrefix}%&0] &3If you haven't been send in 20 seconds, type /mv tp %player%'s Event-1."
            copy dir "plugins/CamCraftCore/CCEvents/eventmap" to "plugins/CamCraftCore/CCEvents/%player%'s Event-1/"
            load world "plugins/CamCraftCore/CCEvents/%player%' Event-1"
            set {event.%player%'s Event-1} to "true"
            wait 20 seconds
        else:
            send "%{Prefix}% &3Your event is still being created or already exists. If you haven't been send in 20 seconds, type /mv tp %player%'s Event-1."

command /closeevent:
    permission: cc.command.eventclose
    permission message: &cInvalid permission, sorry.
    trigger:
        loop all players:
            loop-player's world is "plugins/CamCraftCore/CCEvents/%player%'s Event-1":
                teleport player to spawn of "world"
                make player execute command "/spawn"
        unload world "plugins/CamCraftCore/CCEvents/%player%'s Event-1"
        wait 2 seconds
        delete folder "plugins/CamCraftCore/CCEvents/%player%'s Event-1/data/"
        delete folder "plugins/CamCraftCore/CCEvents/%player%'s Event-1/region/"
        delete file "plugins/CamCraftCore/CCEvents/%player%'s Event-1/level.dat"
        delete file "plugins/CamCraftCore/CCEvents/%player%'s Event-1/uid.dat"
        delete file "plugins/CamCraftCore/CCEvents/%player%'s Event-1/session.lock"
        delete folder "plugins/CamCraftCore/CCEvents/%player%'s Event-1"

This is a very very beta of events so a lot of bugs need to be fixed.
Thanks in advance.

[doublepost=1500313135,1500299165][/doublepost]BUMP
 
Status
Not open for further replies.