#Custom Model Data won't add into the item

1 messages · Page 1 of 1 (latest)

solar mica
#
function SetEnergy2(p: player, n: number):
    set {Energy::%{_p}%} to {_n} # sets energy to the number
    if {_n} is 5:
        loop all items in {_p}'s inventory:
            set line 2 of lore of loop-item to "&f(<##57FFC7>Pristine&f)"
            SetData2({_p}, loop-item)

function SetData2(p: player, i: item):
    if {Energy::%{_p}%} is 5:
        loop all items:
            if lore of loop-item contains "&f&lᴇᴠᴇʀʏᴛʜɪɴɢ ɪs ᴀ ғʟᴜᴄᴛᴜᴀᴛɪᴏɴ":
                set custom model data of loop-item to 15
            else if lore of loop-item contains "&f&lᴄᴏɴᴛʀᴏʟ ᴛʜᴇ ʙᴀʟᴀɴᴄᴇ ᴏғ ʟɪғᴇ":
                set custom model data of loop-item to 3 
            else if lore of loop-item contains "&f&lᴡᴀᴛᴄʜ ᴛʜᴇ ᴡᴏʀʟᴅ ᴀʀᴏᴜɴᴅ ʏᴏᴜ ᴛᴜʀɴ ɪɴᴛᴏ ᴀ ʙʟᴜʀ ":
                set custom model data of loop-item to 7
            else if lore of loop-item contains "&f&lʙᴇ ᴛʜᴇ ʙɪɢɢᴇsᴛ ʙɪʀᴅ":
                set custom model data of loop-item to 5
            else if lore of loop-item contains "&f&lғᴜᴇʟ ᴀ ᴇᴍᴘɪʀᴇ":
                set custom model data of loop-item to 11
            else if lore of loop-item contains "&f&lʜᴀᴠᴇ ᴛʜᴇ sᴛʀᴇɴɢᴛʜ ᴏғ ᴀ ᴀʀᴍʏ":
                set custom model data of loop-item to 9
            else if lore of loop-item contains "&f&lᴍᴀɴᴀɢᴇ ᴛʜᴇ ᴛɪᴅᴇs ᴏғ ᴛʜᴇ ᴄᴏsᴍᴏs":
                set custom model data of loop-item to 13
            else if lore of loop-item contains "&f&lᴍᴀɴɪᴘᴜʟᴀᴛᴇ ғɪʀᴇ":
                set custom model data of loop-item to 1
ruby mesa
#

yes

#

i think u should make a loop to refresh the custom model data

solar mica
#

that's gonna lag

#

no

stuck echo
#

also it's "fuel a__n__ empire" and "the strength of a__n__ army"

solar mica
#

yeah it's just the bliss smp error

#

those aren't my mistakes

#

that's on purpose

stuck echo
#

you're kidding right?

#

why would those mistakes be made on purpose 😂

#

but sure

solar mica
#

nope!

stuck echo
#

loop all items: is probably the issue here

#

that just loops all vanilla items

solar mica
#

oh

#

wait

#

ur right

#

let me test

stuck echo
#

also you have {_i} so why not use that?

solar mica
#

and it did not work

#

any other ways?

stuck echo
solar mica
#

well im not using it anymore

#

anything else?

#

i need it to happen in player's inventory

nocturne ibex
#

then loop inventory of {_p}