#duels skript

1 messages · Page 1 of 1 (latest)

sterile rock
#

Ive been trying all day to make a duels system but i cant get it to work

#
options:
  allow-uninitialized-vars: true

# Define list placeholders for arenas and their states
# Format: {arenaname} = 0 if available, 1 if occupied
on enable:
  set {arenas::*} to {"pvpspawn1"::0, "pvpspawn2"::0, "pvpspawn3"::0}
  send "Arenas initialized: %{arenas::*}%" to console

command /duelqueue:
  trigger:
    if {Queue::*} does not contain player:
      add player to {Queue::*}
      send "&7You joined the queue."
      send "&7Players in queue: %{Queue::*}%"
      loop {arenas::*}:
        set {_arena} to loop-value
        if {arenas::%{_arena}%} is 0:
          set {arenas::%{_arena}%} to 1
          teleport player to location of {_arena}
          send "&aA duel has started!" to player
          wait 1 second
          remove player from {Queue::*}
          wait 60 seconds
          teleport player to 0, 90, 0
          set {arenas::%{_arena}%} to 0
          break
      if {arenas::*} contains 0:
        send "&cNo arenas left"
      else:
        send "&cNo available arenas found"
    else:
      send "&7You are already queued. To leave type &f/leave&7."

command /setduelarena <text>:
  permission: op
  trigger:
    set {_arena_name} to arg-1
    send "Attempting to set arena: %{_arena_name}%" to console
    if {arenas::*} contains {_arena_name}:
      set {arenas::%{_arena_name}%} to location of block at location of player
      send "&6&lpvp spawn %arg-1% set!" to player
      send "&aArena %{_arena_name}% set!" to console
    else:
      send "&cInvalid arena name. Available arenas: %{arenas::*}%" to player

command /leave:
  trigger:
    remove player from {Queue::*}
    send "&7You are no longer queued!"

command /queue:
  trigger:
    send "&7Players in queue: %{Queue::*}%"
#

its just meant to tp you to 1/4 arenas

#

and then to reset the arena

#

it does /rollback rollbackregion pvparena1

#

rollback rollbackregion pvparena2

#

rollback rollbackregion pvparena3

#

rollback rollbackregion pvparena4

shut loom
#

so, when you say it doesnt work, you need to be more specifc

#

as in, which parts dont work, and any error messages you have

sterile rock
#

well

shut loom
#

also, thats not how you define a list.
set {_list::*} to a, b, c, and d

sterile rock
#

whenever i try queue it just shows this

sterile rock
shut loom
#

no

#

when you define the list

sterile rock
#

og yeah

shut loom
#

still no

#

they need to be recogniseable objects, strings, locations, etc

sterile rock
#

how do i set them to locations

#

im quite new to this

#

sorry if i sound stupid

shut loom