1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Invalid book tags

Discussion in 'Skript' started by 0hTristezzah, Sep 8, 2022.

  1. 0hTristezzah

    0hTristezzah New Member

    Joined:
    Mar 28, 2022
    Messages:
    6
    Likes Received:
    0
    options:
    p: &8[&6&lMANDATI&8]


    command /mandato [<text>] [<player>] [<text>]:
    trigger:
    if arg 1 is "stampa":
    if arg 2 is set:
    if arg 3 is {lista::%arg 3%}:
    add 1 of mandato(player, arg-2, arg-3) to player's inventory
    send message "{@p} &7Mandato stampato con successo" to player
    else:
    send message "{@p} &bScegli una fra queste opzioni" to sender
    loop {lista::*}:
    send message "&7%loop-value%" to player
    else:
    send message "&7Inserisci un nickname" to player
    if arg 1 is "add":
    if arg 2 isn't set:
    if arg 3 is set:
    if player has permission "mandato.admin":
    set {lista::%arg 3%} to arg-3
    add arg-3 to {lista::%arg 3%}
    send message "{@p} &b%arg 3% &7Aggiunto alla lista" to sender
    else if arg 1 isn't "stampa" or "add" or "remove" or "clear":
    send "{@p} &7Comando errato, esegui /mandato stampa-add-remove-clear" to player
    if arg 1 is "clear":
    if arg 2 isn't set:
    if arg 3 isn't set:
    if player has permission "mandato.admin":
    clear {lista::*}
    send message "{@p} &7Lista clearata" to sender
    if arg 1 is "remove":
    if arg 2 isn't set:
    if arg 3 is set:
    if player has permission "mandato.admin":
    remove arg-3 from {lista::*}
    send message "&7%arg-3% rimossa dalla lista" to sender

    function mandato(p: player, g: player, n: text) :: item:
    set {_+} to a written book
    set {mandato::id::%{_id}%::autore} to {_p}
    set {mandato::id::%{_id}%::emoji_stuck_out_tongue:ersonasubita} to {_g}
    set {mandato::id::%{_id}%::casa} to {_n}
    add 1 to {mandato::id}
    set {_id} to {mandato::id}
    set {_u} to " &8[&6&lMANDATO&8]%nl%"
    set {_u} to "%{_u}%&8&l----------------%nl%"
    set {_u} to "%{_u}%&8Autore: &7%{_p}%%nl%"
    set {_u} to "%{_u}%&8Casa di: &7%{_g}%%nl%"
    set {_u} to "%{_u}%&8Tipo di casa: &7%{_n}%%nl%"
    set {nowv} to now formatted as "dd/MM/yyyy"
    set {_u} to text component of "%{_u}%&8Data: &7%{nowv}%%nl%"
    set {_u} to "&6Mandato Procura%nl%"
    set {_u} to "&a&lAPPROVATO"
    set page 1 of book {_+} to {_u}
    set book author of {_+} to "&6Procura"
    set book title of {_+} to "&6&lMandato"
    set 1st line of {_+}'s lore to "&7ID: &6%{_id}%"
    return {_+}


    0 error but upload_2022-9-8_1-12-29.png

    upload_2022-9-8_1-13-54.png
     
  2. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    114
    Likes Received:
    4
    This works for me but it also got "outdated" skbee so ye

    Code (Text):
    1.  
    2. command /book:
    3.     trigger:
    4.         add "Page 1"",""clickEvent"":{""action"":""run_command"",""value"":""Bla""}" to {_p::*}
    5.         add "Page 2" to {_p::*}
    6.  
    7.         loop {_p::*}:
    8.             if {_pages} is set:
    9.                 set {_p} to "%{_pages}%,"
    10.             else:
    11.                 set {_p} to ""
    12.             if loop-value contains "clickEvent"":{""action"":""":
    13.                 set {_pages} to "%{_p}%'{""text"":""%loop-value%}'"
    14.             else:
    15.                 set {_pages} to "%{_p}%'{""text"":""%loop-value%""}'"
    16.  
    17.         set {_book} to written book with nbt "{title:""FirstJoinBookLol"",author:""pierrelasse"",pages:[%{_pages}%]}"
    18.         open book {_book} to player
    19.  
     

Share This Page

Loading...