I trying to spawn a creeper when he kill a victim give you points

  • 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.
Feb 24, 2017
191
7
0
23
foroendertheth.foroactivo.com
This is what I have now
Code:
command /test:
    trigger:
        if {creeper::play%player%} is true:
            delete {creeper::play%player%}
        else:
            set {creeper::play%player%} to true
on place of a emerald ore:
    if {creeper::play%player%} is true:
        add 1 to {c::num.%player%}
        spawn a creeper at the event-location
        set the name of the spawned creeper to "&9%player%"
        set {creeper::%spawned creeper%} to true
        add player to {creeper::%spawned creeper%.%{c::num.%player%}%}
        set event-block to air
        remove 1 emerald ore from the player
        
on death:
    if attacker is a creeper:
        if {creeper::%attacker%} is set:
            message "Your creeper kill %victim% +2 points" to {creeper::*}
            broadcast "%{creeper::%spawned creeper%.%{c::num.%player%}%}% creeper blow up %victim%"
The problem is to make a variable of the creeper with the player name inside the variable or something that wend the creeper blows up someone or some player gives you the kill and the points. How I do that ?
 
Is this what you mean? I'm not sure (this uses metadata to save data for entities):
Code:
command /test:
    trigger:
        if {creeper::%player%} is set:
            delete {creeper::%player%}
        else:
            set {creeper::%player%} to true
           
on place of a emerald ore:
    if {creeper::%player%} is set:
        add 1 to {creepernum::%player%}
        spawn a creeper at the event-location
        set the name of the spawned creeper to "&9%player%"
        set metadata "creeper" of spawned creeper to player
        set event-block to air
        remove 1 emerald ore from the player
     
on death:
    if attacker is a creeper:
        if metadata "creeper" of attacker is set:
            message "Your creeper kill %victim% +2 points" to {creeper::*}
            broadcast "%metadata ""creeper"" of attacker% creeper blew up %victim%"
 
Last edited:
Is this what you mean? I'm not sure (this uses metadata to save data for entities):
Code:
command /test:
    trigger:
        if {creeper::%player%} is set:
            delete {creeper::%player%}
        else:
            set {creeper::%player%} to true
           
on place of a emerald ore:
    if {creeper::%player%} is set:
        add 1 to {creepernum::%player%}
        spawn a creeper at the event-location
        set the name of the spawned creeper to "&9%player%"
        set metadata "creeper" of spawn creeper to player
        set event-block to air
        remove 1 emerald ore from the player
     
on death:
    if attacker is a creeper:
        if metadata "creeper" of attacker is set:
            message "Your creeper kill %victim% +2 points" to {creeper::*}
            broadcast "%metadata ""creeper"" of attacker% creeper blew up %victim%"

Can't understand this condition/effect: set metadata "creeper" of spawn creeper to player (creeper.sk, line 13: set metadata "creeper" of spawn creeper to player')
[doublepost=1555430960,1555430833][/doublepost]
Can't understand this condition/effect: set metadata "creeper" of spawn creeper to player (creeper.sk, line 13: set metadata "creeper" of spawn creeper to player')
how metadata works?
 
I updated the code, try again.

I'm not sure, Skript says this, and I can't find much about it here either, besides
Code:
command /true:
    trigger:
        if {creeper::%player%} is set:
            message "Desactivado"
            delete {creeper::%player%}
        else:
            set {creeper::%player%} to true
            message "activado"
on place of a emerald ore:
    if {creeper::%player%} is set:
        add 1 to {creepernum::%player%}
        spawn a creeper at the event-location
        set the name of the spawned creeper to "&9%player%"
        set metadata "creeper" of spawned creeper to player
        set event-block to air
        remove 1 emerald ore from the player
    
on death:
    if attacker is a creeper:
        if metadata "creeper" of attacker is set:
            message "Your creeper kill %victim% +2 points" to {creeper::*} #This line is not working
            add 2 to {points.%{creeper::*}%}#this one is also not working
            broadcast "%metadata ""creeper"" of attacker% creeper blew up %victim%"
 
Code:
command /true:
    trigger:
        if {creeper::%player%} is set:
            message "Desactivado"
            delete {creeper::%player%}
        else:
            set {creeper::%player%} to true
            message "activado"
on place of a emerald ore:
    if {creeper::%player%} is set:
        add 1 to {creepernum::%player%}
        spawn a creeper at the event-location
        set the name of the spawned creeper to "&9%player%"
        set metadata "creeper" of spawned creeper to player
        set event-block to air
        remove 1 emerald ore from the player
  
on death:
    if attacker is a creeper:
        if metadata "creeper" of attacker is set:
            message "Your creeper kill %victim% +2 points" to {creeper::*} #This line is not working
            add 2 to {points.%{creeper::*}%}#this one is also not working
            broadcast "%metadata ""creeper"" of attacker% creeper blew up %victim%"
Oh yeah add where [{creeper::%input%} is set] after that list variable.
Edit: no wait replace the list variable in that line with all players
 
Status
Not open for further replies.