Kill Armor Stand

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

    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!

Status
Not open for further replies.

Leonardo_

Member
Sep 21, 2020
18
0
1
24
Hello,

Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                kill armor stand at {channel.telecamera.%{channel::%arg 1%}%}
                set {channel.telecamera.%{channel::%arg 1%}%} to player's position
                spawn an armor stand at {channel.telecamera.%{channel::%arg 1%}%}
                message "{@prefix} Telecamera posizionata con successo a %location%"

"Can't understand this condition/effect: kill armor stand at {channel.telecamera.%{channel::%arg 1%}%} (line 5: kill armor stand at {channel.telecamera.%{channel::%arg 1%}%}') "
Does anyone know how to solve? Thanks
 
This works for me.

Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                kill {channel::%arg 1%}             
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand
 
This works for me.

Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                kill {channel::%arg 1%}           
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand

yes but when I restart the server and type that command the old armorstand is not deleted
 
This should work even after a server restart.
Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                loop armor stands in radius .00000000001 of {channel::%arg 1%}:
                    kill loop-entity       
                spawn an armor stand at player's location
                add "{telecamera:%arg-1%}" to entity-nbt of last spawned armor stand
                set {channel::%arg 1%} to player's location
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to player's location
 
This should work even after a server restart.
Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                loop armor stands in radius .00000000001 of {channel::%arg 1%}:
                    kill loop-entity     
                spawn an armor stand at player's location
                add "{telecamera:%arg-1%}" to entity-nbt of last spawned armor stand
                set {channel::%arg 1%} to player's location
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to player's location
View attachment upload_2020-10-22_20-51-50.png

It gives me this mistake
@TFS_Mads
[doublepost=1603393625,1603392731][/doublepost]
This should work even after a server restart.
Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                loop armor stands in radius .00000000001 of {channel::%arg 1%}:
                    kill loop-entity      
                spawn an armor stand at player's location
                add "{telecamera:%arg-1%}" to entity-nbt of last spawned armor stand
                set {channel::%arg 1%} to player's location
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to player's location
It only works every now and then, on the move if I spawn the camera doesn't delete it. Could you widen the radius and have it only delete armorstands with the following nbt:
{Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,ArmorItems:[{},{},{},{id:"skull",Count:1b,Damage:3b,tag:{SkullOwner:{Id:"772a2e82-ed7b-4185-bb28-742458fb06ac",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGU1YWEwNDhjZGRhN2Q3YmM3ZGRkZDU5ZmU0M2UwYzZjN2Q1NTY3ZDE0NTE4ZWU1NGE3MjJkOGE1OTE5OCJ9fX0="}]}}}}],HandItems:[{},{}]}
 
Try this.
Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                kill {channel::%arg 1%}         
                spawn an armor stand at player's location
                set {channelpos::%arg 1%} to player's location
                set {channel::%arg 1%} to last spawned armor stand
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand
                
                
on skript unload:
    loop {channel::*}:
        kill loop-value
on skript load:
    loop {channelpos::*}:
        spawn an armor stand at loop-value
        broadcast "-%loop-index%"
        set {channel::%loop-index%} to last spawned armor stand
 
  • Like
Reactions: Leonardo_
yes but when I restart the server and type that command the old armorstand is not deleted
Entities saved to a variable will be lost when the server restarts. The variable data will persist past reloading a script, but if the server is reloaded or restarted then the variables are cleared.
 
Try this.
Code:
command /telecamera [<string>]:
    trigger:
        if player has permission "tv.telecamera.all" or "tv.telecamera.%arg 1%":
            if {channel::%arg 1%} is set:
                kill {channel::%arg 1%}        
                spawn an armor stand at player's location
                set {channelpos::%arg 1%} to player's location
                set {channel::%arg 1%} to last spawned armor stand
                message "Telecamera posizionata con successo a %location%"
            else:
                spawn an armor stand at player's location
                set {channel::%arg 1%} to last spawned armor stand
               
               
on skript unload:
    loop {channel::*}:
        kill loop-value
on skript load:
    loop {channelpos::*}:
        spawn an armor stand at loop-value
        broadcast "-%loop-index%"
        set {channel::%loop-index%} to last spawned armor stand
Ok now I try, but I have another question: I know how to spawn an armorstand, but I can't spawn it with a specific nbt. By any case, do you know how to do it? Thank you again
 
Status
Not open for further replies.