#console command execution
1 messages · Page 1 of 1 (latest)
set {_lore::*} to lore of {_item}
you need to fix this set {_lore::} to lore of {_item}
and loop {_lore::}:
what should i change it too
oh
how do i like send it as a code file
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}
so would kills always be on the same line
i think its the problem of the console commands being wrong or not targeting the item the player is holding
asking for help with AI-generated code is against the rules
doesn't really matter
its my friends
no clue if it is ai or not
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
it certaintly is
the comments are dead giveaways
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?
Being new to skript is fine, we all were at some point
but having AI write things for you
- prevents you from writing code and gaining experience yourself
- 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
oh, ok thanks for this new informations. how could i practice writing skripts that are correct
x8ight suggests that you read https://sovdee.gitbook.io/skript-tutorials/