Solved Event queue system.

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

DoctorHyper

Member
Jul 22, 2017
19
0
1
22
So I know most of the basic things to create a command but im still not good at queues so is there anyway I can make /event join: and the player that sent it joins the queue and gets tped (Also is there a way you can make so that /event join command has a different permission then the /event command?)

Please I need to know how to make the queue system :emoji_slight_smile: I will give you a Like on your comment.

My code i have done:
Code:
command /event [<text>] [<text>]:
    permission: admin.event
    permission message: &8[&bDusk Haven&8] &7You have to be Admin to use this command!
    trigger:
        if arg-1 is "join":
 
Code:
on script load:
    delete {event::*}

on quit:
    if {event::%uuid of player%} is set:
        teleport player to {event::%uuid of player%}
        delete {event::%uuid of player%}

command /event [<text>] [<text>]:
    trigger:
        if arg-1 is "join":
            if player doesn't have permission "join.event":
                send "&8[&bDusk Haven&8] &7You have to be ??? to use this command!"
                stop
            if {event::%uuid of player%} is set:
                send "&8[&bDusk Haven&8] &7U are already in the event."
            set {event::%uuid of player%} to location of player
            set {_queuelocation} to location 0, 0, 0 in world "world"
            teleport player to {_queuelocation}
            send "&8[&bDusk Haven&8] &7Joined the event."
        else if arg-1 is "leave":
            if player doesn't have permission "leave.event":
                send "&8[&bDusk Haven&8] &7You have to be ??? to use this command!"
                stop
            if {event::%uuid of player%} is not set:
                send "&8[&bDusk Haven&8] &7U aren't in the event."
            teleport player to {event::%uuid of player%}
            send "&8[&bDusk Haven&8] &7Left the event."
        else if arg-1 is "start":
            if player doesn't have permission "admin.event":
                send "&8[&bDusk Haven&8] &7You have to be Admin to use this command!"
                stop
            set {_startlocation} to location 0, 0, 0 in world "world"   
            loop {event::*}:
                set {_p} to loop-index parsed as a player
                teleport {_p} to {_startlocation}
            send "&8[&bDusk Haven&8] &7Started event."
        else if arg-1 is "stop":
            if player doesn't have permission "admin.event":
                send "&8[&bDusk Haven&8] &7You have to be Admin to use this command!"
                stop
            loop {event::*}:
                set {_p} to loop-index parsed as a player
                teleport {_p} to loop-value
            delete {event::*}
            send "&8[&bDusk Haven&8] &7Started stopped."
        else:
            if player doesn't have permission "help.event":
                send "&8[&bDusk Haven&8] &7You have to be ??? to use this command!"
                stop
            send "&8[&bEvent&8]"
            if player has permission "join.event":
                send "&7/event join"
            if player has permission "leave.event":
                send "&7/event leave"
            if player has permission "admin.event":
                send "&7/event start"
                send "&7/event stop"
 
  • Like
Reactions: DoctorHyper