duels skript

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

    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!

funpvp

Member
Oct 7, 2023
47
1
8
command /setlobby:
trigger:
set {spawn} to location of player

command /pos1:
trigger:
set {pos1} to location of player

command /pos2:
trigger:
set {pos2} to location of player


command /duel <player>:
permission: fun.duels:
trigger:
{induel} is not true
teleport {pos1}
telport arg 1 {pos2}
set {induel} to true

every 10 ticks:
{induel} is true
loop all players:
send "&cThe Duel is starting in 3 seconds!" to loop-player
wait 20 ticks
send "&cThe Duel is starting in 2 seconds!" to loop-player
wait 20 ticks
send "&cThe Duel is starting in 1 seconds" to loop-player
wait 20 ticks
send "&aGO!" to loop-player
wait 1000 ticks
send "&c30 seconds left!" to loop-player
wait 600 ticks
teleport loop-player to {spawn}
set {induel} to false

i have no clue how to make a duels skript so i just tried this, does anyone else know how
 
Code:
on join:
    set {induel::%player%} to false

command /setlobby:
    trigger:
        if player has permission "spawn":
            set {pos2} to location of player
            send "&2Spawn set successfully!" to player

command /pos1:
    trigger:
        if player has permission "pos":
            set {pos2} to location of player
            send "&2Position 1 set successfully!" to player

command /pos2:
    trigger:
        if player has permission "pos":
            set {pos2} to location of player
            send "&2Position 2 set successfully!" to player


command /duel <player>:
    trigger:
        if player has permission "fun.duels":
            if arg-1 is set:
                if arg-1 is online:
                    if {induel::%player%} is false:
                        if {induel::%arg-1%} is false:
                            teleport player to {pos1}
                            teleport arg-1 to {pos2}
                            set {induel::%player%} to true
                            set {induel::%arg-1%} to true
                            add player to {induel::%player%::%arg-1%::*}
                            add arg-1 to {induel::%player%::%arg-1%::*}
                            send "&cThe Duel is starting in 3 seconds!" to {induel::%player%::%arg-1%::*}
                            wait 1 second
                            send "&cThe Duel is starting in 2 seconds!" to {induel::%player%::%arg-1%::*}
                            wait 1 second
                            send "&cThe Duel is starting in 1 seconds" to {induel::%player%::%arg-1%::*}
                            wait 1 second
                            send "&aGO!" to {induel::%player%::%arg-1%::*}
                            wait 1 minute
                            if {induel::%player%} is true:
                                if {induel::%arg-1%} is true:
                                    if {induel::%player%::%arg-1%::*} contains player and arg-1:
                                        send "&c30 seconds left!" to {induel::%player%::%arg-1%::*}
                                        wait 30 seconds
                                        if {induel::%player%} is true:
                                            if {induel::%arg-1%} is true:
                                                if {induel::%player%::%arg-1%::*} contains player and arg-1:
                                                    teleport {induel::%player%::%arg-1%::*} to spawn
                                                    send "&cThe duel lasted too long, so it was cancelled!" to {induel::%player%::%arg-1%::*}
                                                    clear {induel::%player%::%arg-1%::*}
                                                    delete {induel::%player%::%arg-1%::*}
                                                    set {induel::%arg-1%} to false
                                                    set {induel::%player%} to false
                                                    stop
                        else:
                            send "&c%arg-1% is currently in another duel!" to player
                    else:
                        send "&cYou are currently in duel!" to player
                else:
                    send "&c%arg-1% is not online!" to player
            else:
                send "&cUse: /duel <player>"

on death of player:
    if {induel::%attacker%::%victim%::*} contains attacker:
        if {induel::%attacker%::%victim%::*} contains victim:
            if {induel::%attacker%} is true:
                if {induel::%victim%} is true:
                    teleport {induel::%attacker%::%victim%::*} to {spawn}
                    remove victim from {induel::%attacker%::%victim%::*}
                    send "&aWinner: &6%{induel::%attacker%::%victim%::*}%" to attacker and victim
                    clear {induel::%attacker%::%victim%::*}
                    delete {induel::%attacker%::%victim%::*}
                    set {induel::%attacker%} to false
                    set {induel::%victim%} to false
                    stop
    else if {induel::%victim%::%attacker%::*} contains attacker:
        if {induel::%victim%::%attacker%::*} contains victim:
            if {induel::%attacker%} is true:
                if {induel::%victim%} is true:
                    teleport {induel::%attacker%::%victim%::*} to {spawn}
                    remove victim from {induel::%victim%::%attacker%::*}
                    send "&aWinner: &6%{induel::%victim%::%attacker%::*}%" to attacker and victim
                    clear {induel::%victim%::%attacker%::*}
                    delete {induel::%victim%::%attacker%::*}
                    set {induel::%attacker%} to false
                    set {induel::%victim%} to false
                    stop
 
Last edited: