Solved Data values?

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

RaikaS

Active Member
Apr 6, 2018
53
1
0
20
Hmm, i get errors,

CODE:
code_language.skript:
command /henkkarit [<player>]:
    description: Anna henkkarit
    usage: /henkkarit <pelaaja>
    permission: kaupungit.henkkarit
    permission message: Sinä et voi antaa henkilötodistuksia
    executable by: players
    trigger:
        if arg-1 is not set:
            send "Sinun pitää valita kenelle annat nämä"
        else if player's tool is not a book:
            send "Sinulla ei ole kirjaa"
        else:
            player's tool is book
            set {henkkaripelaaja} to arg-1
            remove player's tool from player
            give book named "Henkilötodistus: %arg-1%" to player
            wait 1 tick
            set data value of book named "Henkilötodistus: %{henkkaripelaaja}%" to "%{henkkaripelaaja}%"
            send "<blue>Henkilötodistuksesi on luotu"
            send "Henkkarit annettu"
on rightclick:
    player's tool is book named "Henkilötodistus: %player%"

    send "Nimi: %{%event-item%.pelaaja}%"
    send "Sääty: %{%event-item%.saaty}%"
    send "Koti: Ei määritetty"
    send "Asuinpaikkakunta: Ei määritetty"
[doublepost=1524374378,1524374314][/doublepost]ERROR : the data of book named "Henkilötodistus: %{henkkaripelaaja}%" can't be set to anything
[doublepost=1524375405][/doublepost]Oh, i cant save anything to data values
 
code_language.skript:
    else:
        player's tool is book
        set {henkkaripelaaja} to arg-1
        remove player's tool from player
        set {_book} to book named "Henkilötodistus: %arg-1%"
        set data value of {_book} to "%arg-1%"
        give {_book} to player
        send "<blue>Henkilötodistuksesi on luotu"
        send "Henkkarit annettu"
 
Status
Not open for further replies.