How to distinguish objects?

  • 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 community!

    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.

temakan

Member
Jan 29, 2017
12
0
0
I made skript and in this skript i can have 2 other types items and it's work for example: red flower and yellow flower and it works, but if i will take 2 same type items like stone pickaxe and stonepickaxe it doesn't care which one it is and assign string of item i used last time. How to make uuid or id for items and then it will be possible to adduction


@edit version Bensku 1.11
addons: skquery, wildskript, skutilities, skmorkaz
no errors, just id of items is not precised

code_language.skript:
variables:
    {ak47.%player%} = 0
    {ak47.%item%} = 30

on rightclick with green_music_disc:
    if {ak47.%player%} is equal to 0:
        if player's tool is green_music_disc named "&cAK-47":
            set {ak47.%item%} to 30
        if {ak47.%item%.} > 0:
            set {ak47.%item%} to {ak47.%item%}-1
            set name of player's tool to "&cAK-47 &3>>%{ak47.%item%}%<<"
            set {ak47.%player%} to 1
            shoot a fireball from player at speed 5
            execute console command "/playsound record.stal block %player% ~ ~ ~ 20 1"
            wait 0.2 seconds
            set {ak47.%player%} to 0
        if {ak47.%item%} is equal to 0:
            if player's inventory has 30 clay_item named "&cNaboje 7.72":
                remove 30 clay_item named "&cNaboje 7.72" from player's inventory
                set {ak47.%item%} to 30
                set name of player's tool to "&cAK-47 &3>>%{ak47.%item%}%<<"
            if player's inventory has 29 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 29
                remove 29 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>29<<"
            if player's inventory has 28 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 28
                remove 28 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>28<<"
            if player's inventory has 27 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 27
                remove 27 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>27<<"
            if player's inventory has 26 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 26
                remove 26 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>26<<"
            if player's inventory has 25 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 25
                remove 25 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>25<<"
            if player's inventory has 24 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 24
                remove 24 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>24<<"
            if player's inventory has 23 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 23
                remove 23 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>23<<"
            if player's inventory has 22 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 22
                remove 22 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>22<<"
            if player's inventory has 21 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 21
                remove 21 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>21<<"
            if player's inventory has 20 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 20
                remove 20 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>20<<"
            if player's inventory has 19 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 19
                remove 19 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>19<<"
            if player's inventory has 18 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 18
                remove 18 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>18<<"
            if player's inventory has 17 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 17
                remove 17 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>17<<"
            if player's inventory has 16 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 16
                remove 16 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>16<<"
            if player's inventory has 15 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 15
                remove 15 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>15<<"
            if player's inventory has 14 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 14
                remove 14 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>14<<"
            if player's inventory has 13 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 13
                remove 13 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>13<<"
            if player's inventory has 12 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 12
                remove 12 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>12<<"
            if player's inventory has 11 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 11
                remove 11 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>11<<"
            if player's inventory has 10 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 10
                remove 10 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>10<<"
            if player's inventory has 9 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 9
                remove 9 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>9<<"
            if player's inventory has 8 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 8
                remove 8 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>8<<"
            if player's inventory has 7 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 7
                remove 7 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>7<<"
            if player's inventory has 6 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 6
                remove 6 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>6<<"
            if player's inventory has 5 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 5
                remove 5 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>5<<"
            if player's inventory has 4 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 4
                remove 4 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-47 &3>>4<<"
            if player's inventory has 3 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 3
                remove 3 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-37 &3>>3<<"
            if player's inventory has 2 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 2
                remove 2 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-37 &3>>2<<"
            if player's inventory has 1 clay_item named "&cNaboje 7.72":
                set {ak47.%item%} to 1
                remove 1 clay_item named "&cNaboje 7.72" from player's inventory
                set name of player's tool to "&cAK-37 &3>>1<<"
            else:
                execute console command "/playsound ui.button.click block %player% ~ ~ ~ 40 2"
       
on leftclick:
    send "%{ak47.%item%}%" to player
 
Last edited:
Use the help format, and post your code. it's unclear exactly what you're trying to accomplish.
As a guess, you can check if an item is equal to a string, which will only accept that string exactly.
But that depends on what your code is. You can change aliases in your aliases folder as well to distinguish how skript recognizes the items. adding different nbts will also distinguish items
 
Use the help format, and post your code. it's unclear exactly what you're trying to accomplish.
As a guess, you can check if an item is equal to a string, which will only accept that string exactly.
But that depends on what your code is. You can change aliases in your aliases folder as well to distinguish how skript recognizes the items. adding different nbts will also distinguish items
code posted
[doublepost=1505854452,1505756293][/doublepost]@24 refresh
 
Try implementing this in to your code

code_language.skript:
command /unstackable <item type>:
    trigger:
        set {_colorcodes::*} to "&a", "&b", "&c", "&d" and "&e"
        set {_ID.lenght} to 100
        loop {_ID.lenght} times:
            add a random element out of {_colorcodes::*} to {_array::*}
        set {_array} to "%{_array::*}%"
        replace every ", " with "" in {_array}
        replace every " and " with "" in {_array}
        give player arg 1 with lore "%colored {_array}%"
 
Status
Not open for further replies.