Solved queue skript help

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

deez nutz

Member
Nov 22, 2019
13
0
1
20
I cant figure out how to teleport one player to {blue.spawn} and another player to {red.spawn}


if executor is console:
if arg-1 is "start":
if {queue1} >= 1:
broadcast "&eThe match is about to start!"
broadcast "&cThe match will begin in &e3 seconds.."
wait 1 seconds
broadcast "&cThe match will begin in &e2 seconds.."
wait 1 seconds
broadcast "&cThe match will begin in &e1 seconds.."
wait 1 second
broadcast "&eTeleporting players.."
loop {queue::*}:
if {queue.%player%} is 2: # Idk how to teleport each player to a spawn
add 1 from {queue1} to {blue.spawn}
delete {queue::*}
delete {queue1}
 
if 2 players enter the queue, after the countdown they both get teleport to the same location, I do not want that. I want 1 player to be teleported to one location and the other player to another.
 
Hmm, so you need the first 2 players who joined?
[doublepost=1586947833,1586942942][/doublepost]
Hmm, so you need the first 2 players who joined?
if so this should work

Code:
command /duels [<text>]:
    permission: console
    trigger:
        if executor is console:
            if arg-1 is "start":
                if {queue1} >= 1:
                    broadcast "&eThe match is about to start!"
                    broadcast "&cThe match will begin in &e3 seconds.."
                    wait 1 seconds
                    broadcast "&cThe match will begin in &e2 seconds.."
                    wait 1 seconds
                    broadcast "&cThe match will begin in &e1 seconds.."
                    wait 1 second
                    broadcast "&eTeleporting players.."
                    teleport {duel1pos1} to {duelblue}
                    teleport {duel1pos2} to {duelred}
                    delete {duel1pos1}
                    delete {duel1pos2}
                    delete {queue1}

command /duelenter:
    trigger:
        if {duel1pos1} is not set:
            set player to {duel1pos1}
            add 1 to {queue1}
        else:
            if {duel1pos2} is not set:
                set player to {duel1pos2}
                add 1 to {queue1}

command /duel1setspawn [<text>]:
    permission: *
    trigger:
        if arg-1 is not set:
            send "&FUsage: /duel1setspawn 1/2"
        if arg-1 is set:
            if arg-1 is "1":
                set {duel1pos1} to player's location
                send "&ASuccess"
            else:
                if arg-1 is "2":
                    set {duel1pos2} to player's location
                    send "&ASuccess"
 
Ight 1 sec
[doublepost=1586950851,1586950718][/doublepost]
Code:
command /duels [<text>]:
    permission: console
    trigger:
        if executor is console:
            if arg-1 is "start":
                if {queue1} >= 1:
                    broadcast "&eThe match is about to start!"
                    broadcast "&cThe match will begin in &e3 seconds.."
                    wait 1 seconds
                    broadcast "&cThe match will begin in &e2 seconds.."
                    wait 1 seconds
                    broadcast "&cThe match will begin in &e1 seconds.."
                    wait 1 second
                    broadcast "&eTeleporting players.."
                    teleport {duel1pos1::1} to {duelblue}
                    teleport {duel1pos2::1} to {duelred}
                    delete {duel1pos1}
                    delete {duel1pos2}
                    delete {queue1}

command /duelenter:
    trigger:
        if {duel1pos1} is not set:
            add player to {duel1pos1::*}
            set {duel1pos1} to "random"
            add 1 to {queue1}
        else:
            if {duel1pos2} is not set:
                set {duel1pos2} to "random"
                add player to {duel1pos2::*}
                add 1 to {queue1}
Should work
 
i have set the spawnpoints, got my mate and I to do /duelenter and /duels start it wont do anything? sorry to take up your time
 
Any Errors while loading the skript?
[doublepost=1586951542,1586951454][/doublepost]Also the executor has to be console
sense you put that in you skript
 
yeah it didn't work, ill attempt this tomorrow because it is late for me my friend will be on tomorrow so ill be able to test it properly with another player, ill let you know how it works out with the skript.
[doublepost=1587026325,1586952791][/doublepost]It didn't work i ran /duels start by console when 2 players type /duelenter
 
yeah it didn't work, ill attempt this tomorrow because it is late for me my friend will be on tomorrow so ill be able to test it properly with another player, ill let you know how it works out with the skript.
[doublepost=1587026325,1586952791][/doublepost]It didn't work i ran /duels start by console when 2 players type /duelenter

didn't test + parser was dooing weird for me

Code:
command /setrandomlocations:
    trigger:
        add location of player to {Duels::Locations::*}

command /resetlocations:
    trigger:
        add location of player to {Duels::Locations::*}

on script load:
    delete {Duels::Queue::*}

on quit:
    delete {Duels::Queue::%uuid of player%}

command /start:
    trigger:
        if command sender is console:
            if size of {Duels::Queue::*} >= 2:
                if size of {Duels::Queue::*} <= size of {Duels::Locations::*}:
                    send "We gonna start" to {Duels::Queue::*}
                    loop 5 times:
                        send "%6 - (loop-number)%" to {Duels::Queue::*}
                        wait 1 second
                    send "FIGHT" to {Duels::Queue::*}
                    set {_locs::*} to {Duels::Locations::*}
                    loop {Duels::Queue::*}:
                        set {_r} to random element out of {Duels::Locations::*}
                        teleport loop-value to {_r}
                        remove {_r} from {Duels::Locations::*}
                    delete {Duels::Queue::*}

command /enter:
    trigger:
        if size of {Duels::Queue::*} <= size of {Duels::Locations::*}:
            if {Duels::Queue::%uuid of player%} is not set:
                set {Duels::Queue::%uuid of player%} to player
 
Status
Not open for further replies.