#console command execution

1 messages · Page 1 of 1 (latest)

plain chasm
#

when i kill someone the lore of the item does not update

#

or change

next obsidian
#

set {_lore::*} to lore of {_item}

#

you need to fix this set {_lore::} to lore of {_item}

#

and loop {_lore::}:

plain chasm
#

what should i change it too

next obsidian
#

add *

#

just {_lore::*} add the star after ::

#

to make it a list

plain chasm
#

for the 2 things u said

#

?

#

its already that

#

but like discord makes ti weird

next obsidian
#

oh

plain chasm
#

how do i like send it as a code file

next obsidian
#

`

#

three times around it

plain chasm
#
    if attacker is a player:
        set {_player} to attacker
        set {_item} to tool of {_player}

        # Check if the item is a golden sword named "&6SUMMER SWORD"
        if {_item} is not a golden sword:
            stop
        if name of {_item} is not "&6SUMMER SWORD":
            stop

        # Check if the item is unbreakable
        if {_item} is not unbreakable:
            stop

        # Get the lore and check if "Kills:" is present
        set {_lore::*} to lore of {_item}
        set {_found} to false
        loop {_lore::*}:
            if loop-value contains "Kills: ":
                set {_kills} to (loop-value parsed as integer) + 1
                set {_found} to true
                stop

        if {_found} is false:
            set {_kills} to 1

        # Now execute the item editor commands, correctly formatting the kills variable
        execute console command "/ie lore remove last"
        execute console command "/ie lore add &7Kills &6%{_kills}%"

        # Optional: Confirm the change to the player
        send "&7Lore updated with new kill count!" to {_player}

next obsidian
#

so would kills always be on the same line

plain chasm
#

yeah

#

like

plain chasm
wooden flare
#

asking for help with AI-generated code is against the rules

next obsidian
#

doesn't really matter

plain chasm
#

no clue if it is ai or not

wooden flare
#

it does.
They used AI because they dont have a confident foundation in skript
they need to learn the basics to be able to progress furthur instead of copy-pasting whatever AI regurgitates/makes up syntax for

wooden flare
#

the comments are dead giveaways

plain chasm
#

should i tell him

#

bec like im new to skript too

#

idk what this is saying tbh

#

is like ai code bad code in general or bad as of learning wise?

wooden flare
#

Being new to skript is fine, we all were at some point
but having AI write things for you

  1. prevents you from writing code and gaining experience yourself
  2. AI just regurgitates whatever it finds, and does its best to modify it/fill in the blanks. This means AI usually:
  • confuses skript with python
  • just plainly makes up gibberish syntax
  • recycles plenty of mistakes that are popular with new users/older tutorials and are bad habits to reproduce

If someone (you or your friend) want to improve, the best thing is to look at tutorials, get a good understanding of the basics, and then practice, practice, practice. Experiment with what you find on the docs etc

If your friend is your developer for a server or whatever, and is supposed to supply you with functional, reasonably-professional code, and then they dont know anything about using skript, and attempt to pass of broken AI code as their own to hide their inability, I definitely wouldnt rely on them

plain chasm
winter jayBOT
wooden flare
#