ban hammer code not working

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

j_91

Member
Jun 10, 2023
3
0
1
i'm new to skripting, i dont see what's wrong with this code

on damage:
---damage is caused by an attack
----victim is a player
----if attacker is holding a netherite axe named "&0<bold>Ban &4<bold>Hammer":
-------broadcast "&8<bold>%victim% &7Has been banned by %attacker% using &0<bold>Ban &4<bold>Hammer"
-------kill victim
-------execute console command "ban %victim%"
 
Last edited:
i'm new to skripting, i dont see what's wrong with this code

on damage:
---damage is caused by an attack
----victim is a player
----if attacker is holding a netherite axe named "&0<bold>Ban &4<bold>Hammer":
-------broadcast "&8<bold>%victim% &7Has been banned by %attacker% using &0<bold>Ban &4<bold>Hammer"
-------kill victim
-------execute console command "ban %victim%"
Hello, j_91. It is usually good practice to put your code inside a code block for the sake of readability. You can do this by clicking the `Insert` button and then selecting `Code Block` from the menu at the top when writing a message. Also, please always include all the errors and issues you encounter while executing the code / testing it, so that we can better assist you with your problem. Please let us know what is not working in your code so we can help you fix the issue.

As for the script, you can usually resolve most issues by debugging your code. Debugging allows you to pinpoint the error, so you spend more time fixing it than looking for it. You can find an extensive guide on how to debug your code HERE.
 
  • Like
Reactions: j_91
Hello, j_91. It is usually good practice to put your code inside a code block for the sake of readability. You can do this by clicking the `Insert` button and then selecting `Code Block` from the menu at the top when writing a message. Also, please always include all the errors and issues you encounter while executing the code / testing it, so that we can better assist you with your problem. Please let us know what is not working in your code so we can help you fix the issue.

As for the script, you can usually resolve most issues by debugging your code. Debugging allows you to pinpoint the error, so you spend more time fixing it than looking for it. You can find an extensive guide on how to debug your code HERE.

okay, thank you
[doublepost=1686472692,1686469383][/doublepost]
Hello, j_91. It is usually good practice to put your code inside a code block for the sake of readability. You can do this by clicking the `Insert` button and then selecting `Code Block` from the menu at the top when writing a message. Also, please always include all the errors and issues you encounter while executing the code / testing it, so that we can better assist you with your problem. Please let us know what is not working in your code so we can help you fix the issue.

As for the script, you can usually resolve most issues by debugging your code. Debugging allows you to pinpoint the error, so you spend more time fixing it than looking for it. You can find an extensive guide on how to debug your code HERE.

i debugged it like you said, but i still cant get the name part(netherite axe named ... ), it also does not show errors


Code:
on damage:
    damage is caused by an attack
    if victim is holding netherite axe named "&0<bold>Ban &4<bold>Hammer":
        broadcast "%victim%"

it works without the name part.
[doublepost=1686498370][/doublepost]update:

Code:
on damage:
    damage is caused by an attack
    if victim is holding netherite axe named "hii":
        broadcast "%victim%"
       
on damage:
    damage is caused by an attack
    if victim is holding stick named "hi":
        broadcast "%victim%"
i dont know why, but the stick part works fine, but the netherite axe part doesnt.
also a normal netherite axe works fine too, but with name it doesnt