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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
on damage of armor stand:
send "bonk" to attacker #code can be executed In front of cancel event
cancel event
add 1 to {hits} #code can be executed after cancel event
if {hits} >= 10:
send "you have hit the armor stand %{hits}% times" to attacker
else:
send "ouch" to attacker
Thank u! Il see if it worksthis small example should work
Python:on damage of armor stand: send "bonk" to attacker #code can be executed In front of cancel event cancel event add 1 to {hits} #code can be executed after cancel event if {hits} >= 10: send "you have hit the armor stand %{hits}% times" to attacker else: send "ouch" to attacker
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at player's location
set {_target} to last spawned entity
set string tag "special" of custom nbt of {_target} to "special"
on damage of armor stand:
set {_tag} to string tag "special" of custom nbt of victim
if {_tag} is "special":
add 1 to damage value of attacker's tool
cancel event
there are 2 errors in line 6 and 9Try this. Haven't tested, feel free to ask if there's errors.
Python:command /spawnarmorstand: permission: op trigger: spawn armor stand at player's location set {_target} to last spawned entity set string tag "special" of custom nbt of {_target} to "special" on damage of armor stand: set {_tag} to string tag "special" of custom nbt of victim if {_tag} is "special": add 1 to damage value of attacker's tool cancel event
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at location of player
set {_as} to last spawned entity
set metadata "special" of {_as} to true
on damage of armor stand:
if metadata "special" of victim is true:
add 1 to damage value of attacker's tool
cancel event
It breaks afer 2 quick tapshere you go
Python:command /spawnarmorstand: permission: op trigger: spawn armor stand at location of player set {_as} to last spawned entity set metadata "special" of {_as} to true on damage of armor stand: if metadata "special" of victim is true: add 1 to damage value of attacker's tool cancel event
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at location of player
set {_as} to last spawned entity
set metadata "special" of {_as} to true
on damage of armor stand:
if metadata "special" of victim is true:
add 1 to damage value of attacker's tool
send "test true" to attacker
cancel event
dosent send the messagetry this, if it sends the message it works otherwise I'll change it
Python:command /spawnarmorstand: permission: op trigger: spawn armor stand at location of player set {_as} to last spawned entity set metadata "special" of {_as} to true on damage of armor stand: if metadata "special" of victim is true: add 1 to damage value of attacker's tool send "test true" to attacker cancel event
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at location of player
set {_as} to last spawned entity
set custom name of {_as} to "SpecialArmorStand"
set custom name visibility of {_as} to false
on damage of armor stand:
attacker is a player
custom name of victim is "SpecialArmorStand"
add 1 to damage value of attacker's tool
send "test true" to attacker
cancel event
command /armorstand:
trigger:
set {_n} to nbt compound from "{Invulnerable:1b}"
spawn armor stand at player with nbt {_n}
#Code is not tested and skUnity Parser isn't working.
In the case this code does not work, try this version:If you want to have an entity that is invulnerable, I'd recommend downloading and installing SkBee.
Shane has created the ability to edit nbt compound, meaning the tags/flags an entity has, such as NoAI, Invisibilty, or invulnerability!
If you then use the reference here for your code, you can create the nbt compound of invulnerability and attach it to your armor stand. The code is shown below.
Code:command /armorstand: trigger: set {_n} to nbt compound from "{Invulnerable:1b}" spawn armor stand at player with nbt {_n} #Code is not tested and skUnity Parser isn't working.
command /armorstand:
trigger:
spawn armor stand at player
set {_n} to nbt compound of last spawned armor stand
set boolean tag "Invulnerable" of {_n} to true
set nbt compound of last spawned armor stand to {_n}
error at 7 and 14maybe this? uses names insted
Python:command /spawnarmorstand: permission: op trigger: spawn armor stand at location of player set {_as} to last spawned entity set custom name of {_as} to "SpecialArmorStand" set custom name visibility of {_as} to false on damage of armor stand: attacker is a player custom name of victim is "SpecialArmorStand" add 1 to damage value of attacker's tool send "test true" to attacker cancel event
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at location of player
set {_as} to last spawned entity
set metadata value "armorStand" of {_as} to "SpecialArmorStand"
on damage of armor stand:
attacker is a player
metadata value "armorStand" of victim
add 1 to damage value of attacker's tool
send "test true" to attacker
cancel event
error at line 12Python:command /spawnarmorstand: permission: op trigger: spawn armor stand at location of player set {_as} to last spawned entity set metadata value "armorStand" of {_as} to "SpecialArmorStand" on damage of armor stand: attacker is a player metadata value "armorStand" of victim add 1 to damage value of attacker's tool send "test true" to attacker cancel event