Jump to content

Skript Help please


Shadow_UTubes

Recommended Posts

 

Hi so im making a Skript so when the queue hits enough people it makes console run a command to teleport everyone in the list to the arena heres my code so far (or make all players execute a the command /tp_vilage) I want them all to run the command or make the console run the command to send them all to the place

 

#Make it teleport all players

command /queue_vilage:
    trigger:
        if {QueueVilage::*} does not contain player:
            add player to {QueueVilage::*}
        else:
            send "&aAlready in queue!"
        loop {QueueVilage::*}:
            add 1 to {_vilagequeue}
            if {_vilagequeue} is 2:
                execute player command "/tp_vilage"
                #only teleports last person to join the queue
            

command /unqueue_vilage:
    trigger:
        remove player from {QueueVilage::*}
        if {QueueVilage::*} contains player:
            subtract 1 from {_vilagequeue}
            send "&cNo longer in queue"
        
command /queue_list_vilage:
    permission: op
    trigger:
        send "&aPeople in the queue: &f%{QueueVilage::*}%"
        
command /queue_vilage_amount:
    permission: op
    trigger:
        send "There are %{_vilagequeue}% people in the queue"
        
command /queue_vilage_reset:
    trigger:
        clear {Variable2::*}
        send "&cCleared the queue!"
    trigger:
        set {_vilagequeue} to 0

 

my code for /tp_vilage

 

command /tp_vilage:
    trigger:
        set {_x} to random integer between -28 and 28
        set {_z} to random integer between 211 and 151
        set {_loc} to location({_x}, 0, {_z})
        set {_loc2} to location of block below highest block at {_loc}
        loop blocks between {_loc} and {_loc2}:
            if loop-block is air:
                set {_bloc} to block below loop-block
                teleport player to {_bloc}
                stop loop

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...