Problem with Delete and set list on my 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 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.

Cebix4k

Member
Aug 5, 2022
1
0
1
26
My Server is running on 1.19.1 Paper

i m Using Skript Skrayfall SkQuery Skeleton Skript-Gui SQ-Library Score

(UPDATE)
So i have Recoded the Code and now is the code Responding now i have the problem to remove the id from list while list is set brot and brot2 in the list can't removed by the delete command and the same problem by the set command....


Code:
command /sethead2 [<text>] [<text>] [<text>]:
   trigger:    
       if arg-1 is "list":
           if {nm::*} is not set:
               send "&8| &6&lHeadset §8» &cKeine IDs in Der Liste Vorhanden!"
               stop
           if {nm::*} is set:
               send "&8| &6&lHeadset §8» &cListe aller IDs: &e%{nm::*}%"
               stop
       if arg-1 is "delete":
           if arg-2 is not set:
               send "&8| &6&lHeadset §8» &cGebe einen Namen an denn du Löschen willst!"
               stop
           if {nm::*} is not set:
               send "&8| &6&lHeadset §8» &cKeine IDs in Der Liste Vorhanden!"
               stop
           if {nm::*} is not arg-2:
               send "&8| &6&lHeadset §8» &cKonnte nicht mit dem namen &e%arg-2% &cFinden! &7(&a%{nm::*}%&7)"
               stop
           if {nm::*} is arg-2:
               loop {nm::*}:
                   remove arg-2 from {nm::*}
                   send "&8| &6&lHeadset §8» &aDu hast die ID &c%arg-2% &aEntfernt!"
       if arg-1 is "set":
           if arg-2 is not set:
               send "&8| &6&lHeadset §8» &aDu hast Keinen Namen Angegeben!"
               stop
           if arg-2 is {nm::*}:
               send "&8| &6&lHeadset §8» &cDie ID: &e%{nm::*}% &cist Bereits Gesetzt!"
               stop
           if arg-2 is set:
               loop {nm::*}:
                   add arg-2 to {nm::*}
                   send "&8| &6&lHeadset §8» &aDie ID: &e%{nm::*}% &aist jetzt Erstellt!"
           if {nm::*} is "Leer":
               delete {nm::*}
           if {nm::*} is not set:
               add arg-2 to {nm::*}
               give 1 stick with name "§eKopfmarkieren &8| &e%{nm::*}%" to player
               send "&8| &6&lHeadset §8» &aSetze denn Kopf-Event mit Rechtsklick &8| &7%{nm::*}%"
               set {toggle.%player%} to true
               stop



     
on rightclick:
    name of player's tool is "§eKopfmarkieren &8| &7%{nm}%":
        if {toggle.%player%} is false:
            stop
        if {toggle.%player%} is true:
            if player is sneaking:
                set {headset} to location of block
                send "&8| &6&lBrot §8» &7block gesetzt! LOC = &a%{headset}%"

     
on rightclick:
    if location of block is not {headset}:
        stop
    if location of block is {headset}:
        if {headset} is set:
            if {nm} is "brot":
                chance of 15%:
                    send "&8| &6&lBrot §8» &aAua! wiso Haust du mich?"
                    drop bread with name "&eBrotstücke"
 
Last edited:
try this (Btw I recommend using %player's uuid% instead of %player% because players have the ability to change their usernames)

Code:
command /sethead2 [<text>] [<text>] [<text>]:
  trigger:   
      if arg-1 is "list":
          if {nm::*} is not set:
              send "&8| &6&lHeadset §8» &cKeine IDs in Der Liste Vorhanden!"
              stop
          if {nm::*} is set:
              send "&8| &6&lHeadset §8» &cListe aller IDs: &e%{nm::*}%"
              stop
      if arg-1 is "delete":
          if arg-2 is not set:
              send "&8| &6&lHeadset §8» &cGebe einen Namen an denn du Löschen willst!"
              stop
          if {nm::*} is not set:
              send "&8| &6&lHeadset §8» &cKeine IDs in Der Liste Vorhanden!"
              stop
          if {nm::*} contains arg-2:
              remove arg-2 from {nm::*}
              send "&8| &6&lHeadset §8» &aDu hast die ID &c%arg-2% &aEntfernt!"
              stop
          send "&8| &6&lHeadset §8» &cKonnte nicht mit dem namen &e%arg-2% &cFinden! &7(&a%{nm::*}%&7)"
          stop # Changed orders and format a bit here for better code
      if arg-1 is "set":
          if {nm::*} contains arg-2:
              send "&8| &6&lHeadset §8» &cDie ID: &e%{nm::*}% &cist Bereits Gesetzt!"
              stop
          if arg-2 is "Leer": # Note: Here it was "if {nm::*} is "Leer":" but I assumed that you meant arg-2 instead of {nm::*}, so I replaced {nm::*} with arg-2
              delete {nm::*}
          if arg-2 is set:
              if {nm::*} is not set:
                  add arg-2 to {nm::*}
                  give 1 stick with name "§eKopfmarkieren &8| &e%{nm::*}%" to player
                  send "&8| &6&lHeadset §8» &aSetze denn Kopf-Event mit Rechtsklick &8| &7%{nm::*}%"
                  set {toggle.%player%} to true
                  stop

              add arg-2 to {nm::*}
              send "&8| &6&lHeadset §8» &aDie ID: &e%{nm::*}% &aist jetzt Erstellt!"
              stop
          send "&8| &6&lHeadset §8» &aDu hast Keinen Namen Angegeben!"
          stop # Changed orders and format a bit here too



    
on rightclick:
   name of player's tool is "§eKopfmarkieren &8| &7%{nm}%":
       if {toggle.%player%} is false:
           stop
       if {toggle.%player%} is true:
           if player is sneaking:
               set {headset} to location of block
               send "&8| &6&lBrot §8» &7block gesetzt! LOC = &a%{headset}%"

    
on rightclick:
   if location of block is not {headset}:
       stop
   if location of block is {headset}:
       if {headset} is set:
           if {nm} is "brot":
               chance of 15%:
                   send "&8| &6&lBrot §8» &aAua! wiso Haust du mich?"
                   drop bread with name "&eBrotstücke"
 
Status
Not open for further replies.