J'ai une pvpbox et j'ai un problème, quand un joueur mourrait de Feu / Vide ou autre, l'attacker ne recevait pas les coins bonus car cela détectait pas qu'il était l'attacker.
J'ai réussi à détecter l'attacker en créant une variable {tueur} (Voir Code)
Le problème maintenant c'est que je ne n'arrive pas à donner l'argent au {tueur}.
on death of player:
if player's world is "pvpbox":
heal victim
teleport victim to {lobby.pvpbox}
if {tueur} is a player:
add 1 to {coins.%UUID of attacker%}
add 1 to {kills.%uuid of attacker%}
add 1 to {killstreak.%uuid of attacker%}
add 1 to {morts.%uuid of victim%}
send message "{@prefixpvpita} &8&oTu as tué %victim%" to attacker
send message "{@prefixpvpita} &8&oTu as tué %victim%" to {tueur}
send message "{@prefixpvpita} &8&o%{tueur}% vous a tué" to victim
if {killstreak.%uuid of attacker%} > {best.killstreak.%uuid of attacker%}:
set {best.killstreak.%uuid of attacker%} to {killstreak.%uuid of attacker%}
if {killstreak.%uuid of victim%} > 4:
broadcast "%attacker% a mis fin à la série de %victim% ! (%{killstreak.%uuid of victim%}%)"
if {killstreak.%uuid of attacker%} is 5:
add 1 to {killsteak.%uuid of attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &65&c kills !"
add 5 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+5 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
if {killstreak.%uuid of attacker%} is 10:
add 1 to {killsteak.%uuid of attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &610&c kills !"
add 10 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+10 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
if {killstreak.%uuid of attacker%} is 15:
add 1 to {killsteak.%attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &615&c kills !"
add 15 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+15 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
if {killstreak.%uuid of attacker%} is 20:
add 1 to {killsteak.%uuid of attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &620&c kills !"
add 20 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+20 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
if {killstreak.%uuid of attacker%} is 25:
add 1 to {killsteak.%uuid of attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &625&c kills !"
add 25 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+25 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
if {killstreak.%uuid of attacker%} is 30:
add 1 to {killsteak.%uuid of attacker%}
broadcast "{@prefixpvp} &6%attacker%&c est en série de &630&c kills !"
add 30 to {coins.%UUID of attacker%}
send message "{@prefixscita} &e&o+30 &b&oSelaCoins &7&o(&d&oBONUS KillStreak&7&o)" to attacker
stop
else:
send message "{@prefixpvpita} &8&oTu es mort tout seul" to victim
on damage:
if attacker is a player:
if victim is a player:
set {tueur} to attacker
set {victim} to victim
message "Tu es attacker" to {tueur}
on death of player:
if victim is {victim}:
clear {tueur}
clear {victim}
Je vous ai passé tout le code, mais la plus grande partie ne sert qu'aux killstreaks.
Dans le cas présent pour donner l'argent je fais ça : "add 1 to {coins.%UUID of attacker%}" sauf que l'argent est give à l"attacker" et non au "{tueur}". J'ai essayé "add 1 to {coins.%UUID of {tueur}%} mais ne fonctionne pas :/
Merci d'avance et redites moi si je ne suis pas clair ^^
Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.
Question
Gingly
Bonjour à tous,
J'ai une pvpbox et j'ai un problème, quand un joueur mourrait de Feu / Vide ou autre, l'attacker ne recevait pas les coins bonus car cela détectait pas qu'il était l'attacker.
J'ai réussi à détecter l'attacker en créant une variable {tueur} (Voir Code)
Le problème maintenant c'est que je ne n'arrive pas à donner l'argent au {tueur}.
Je vous ai passé tout le code, mais la plus grande partie ne sert qu'aux killstreaks.
Dans le cas présent pour donner l'argent je fais ça : "add 1 to {coins.%UUID of attacker%}" sauf que l'argent est give à l"attacker" et non au "{tueur}". J'ai essayé "add 1 to {coins.%UUID of {tueur}%} mais ne fonctionne pas :/
Merci d'avance et redites moi si je ne suis pas clair ^^
12 réponses à cette question
Messages recommandés