Solved Help me :D

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

BoxMiners

Member
Jul 19, 2022
47
0
6
18
Code:
command /duel [<offline player>]:
 cooldown: 1 minute
 trigger:
  if arg 1 is not set:
   send "&cNot a valid player"
  else if arg 1 is set:
   send "&a%player% wants to duel you | /request accept %player% to accept" to arg 1
   send "&aSuccessfully send a request to %arg-1%"
   set {request.%player%} to true
   set {asked.%arg-1%} to true
   wait 1 minute
   delete {asked.%arg-1%} and {request.%player%}

command /request [<text>] [<offline player>]:
 trigger:
  if arg 1 is not set:
   send "&cNot a valid type"
   send "&cOptions: Accept, Deny"
  if arg 1 is set:
   if arg 2 is not set:
    send "&cNot a valid player"
   if arg 1 is "accept":
    if arg 2 is set:
     if {request.%arg-2%} is set:
      if {asked.%player%} is set:
       teleport arg 2 to location(-241, 94, -281, world "world")
       teleport player to location(-241, 94, -241, world "world")
       set {duels.%player%} to true
       wait 1 tick
       clear {duel.%player%::*}
       loop 36 times:
        set {duel.%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
       send "&8[&aBoxMinersV&8]  &7The Backpack was saved."
       wait 10 ticks
       clear player's inventory
       stop

on respawn:
 if {duels.%player%} is set:
  wait 1 tick
  delete {duels.%player%}
  wait 5 ticks
  open chest with 4 rows named "&aSaved Items" to player
  wait 2 tick
  loop {duel.%player%::*}:
   add loop-value to current inventory of player
   set {secstore.%player%} to true
   stop
I was making a duels skript then i tried to make it so it saves your stuff in a thing. But it didnt work. Everything works fine exept when you respawn the items dont come in the chest. There is no errors reloading, i couldnt find online on other websites. If you know how to fix this then please reply
 
Code:
command /duel [<offline player>]:
 cooldown: 1 minute
 trigger:
  if arg 1 is not set:
   send "&cNot a valid player"
  else if arg 1 is set:
   send "&a%player% wants to duel you | /request accept %player% to accept" to arg 1
   send "&aSuccessfully send a request to %arg-1%"
   set {request::%player%} to true
   set {asked::%arg-1%} to true
   wait 1 minute
   delete {asked::%arg-1%} and {request::%player%}
 
command /request [<text>] [<offline player>]:
 trigger:
  if arg 1 is not set:
   send "&cNot a valid type"
   send "&cOptions: Accept, Deny"
  if arg 1 is set:
   if arg 2 is not set:
    send "&cNot a valid player"
   if arg 1 is "accept":
    if arg 2 is set:
     if {request::%arg-2%} is set:
      if {asked::%player%} is set:
       teleport arg 2 to location(-241, 94, -281, world "world")
       teleport player to location(-241, 94, -241, world "world")
       set {duels::%player%} to true
       set {duel::%player%::*} to all items in inventory of player
       send "&8[&aBoxMinersV&8]  &7The Backpack was saved."
       clear player's inventory
       stop
 
on respawn:
  if {duels::%player%} is set:
    delete {duels::%player%}
    set {_inventory} to chest inventory with 4 rows named "&aSaved Items"
    loop {duel::%player%::*}:
      add loop-value to {_inventory}
    open {_inventory} to player
    set {secstore::%player%} to true
 
Code:
command /duel [<offline player>]:
 cooldown: 1 minute
 trigger:
  if arg 1 is not set:
   send "&cNot a valid player"
  else if arg 1 is set:
   send "&a%player% wants to duel you | /request accept %player% to accept" to arg 1
   send "&aSuccessfully send a request to %arg-1%"
   set {request::%player%} to true
   set {asked::%arg-1%} to true
   wait 1 minute
   delete {asked::%arg-1%} and {request::%player%}
 
command /request [<text>] [<offline player>]:
 trigger:
  if arg 1 is not set:
   send "&cNot a valid type"
   send "&cOptions: Accept, Deny"
  if arg 1 is set:
   if arg 2 is not set:
    send "&cNot a valid player"
   if arg 1 is "accept":
    if arg 2 is set:
     if {request::%arg-2%} is set:
      if {asked::%player%} is set:
       teleport arg 2 to location(-241, 94, -281, world "world")
       teleport player to location(-241, 94, -241, world "world")
       set {duels::%player%} to true
       set {duel::%player%::*} to all items in inventory of player
       send "&8[&aBoxMinersV&8]  &7The Backpack was saved."
       clear player's inventory
       stop
 
on respawn:
  if {duels::%player%} is set:
    delete {duels::%player%}
    set {_inventory} to chest inventory with 4 rows named "&aSaved Items"
    loop {duel::%player%::*}:
      add loop-value to {_inventory}
    open {_inventory} to player
    set {secstore::%player%} to true
thank you so much :emoji_grinning:
 
Status
Not open for further replies.