Aller au contenu
  • 0

Killcash, pas de gain suite à la pousse ..


Question

Posté(e)

Version de Minecraft : 1.8.9
Version de Skript : 2.2

Type du skript : Killcash, donne une récompense (Money ig) suite à un kill de joueur

Description du script :

Bonjour !

Petit problème avec mon systeme de killcash. Lorsqu'un joueur tue un autre joueur, l'attaqueur gagne 1 Creep's (creep's = money IG)

Jusqu'à la tout va bien. 

Petit problème.

Quand un joueur pousse l'autre joueur dans un troup. La victime meurt du dégat de chute. Et l'attaquant ne gagne pas de Creep's 😞

Je sais pas si c'est bien expliquer.. Je l'éspère.

Voila une partie de mon code

 

on death:
    attacker is a player:
        victim is a player:
            if attacker or victim is not in world "lobby":
                send "&a+1.0" to attacker
                add 1 to attacker's balance
                send "&cVous êtes mort(e) contre %attacker%" to victim
                send "&aVous venez de détruire %victim% !" to attacker

14 réponses à cette question

Messages recommandés

  • 0
Posté(e)
il y a une heure, TheRemiDev a dit :

Hello !

Tu dois faire une variable temporaire, qui contiens la dernière personne qui a frappé le joueur en question avant ça mort 😉 !

Hmmm... Comment pourais-je faire cela ?

  • 0
Posté(e)

Je suis un peu fatigué, et j'ai pas scripté depuis longtemps, mais je verrais ça un peu dans ce style :

on fight:
    if attacker is a player:
        if victim is a player:
            set {fight.%victim%} to "%attacker%"
on death of player:
    #addcoins to {fight.%victim%}

  • 0
Posté(e)
Il y a 18 heures, TheRemiDev a dit :

Je suis un peu fatigué, et j'ai pas scripté depuis longtemps, mais je verrais ça un peu dans ce style :

 


on fight:
    if attacker is a player:
        if victim is a player:
            set {fight.%victim%} to "%attacker%"
on death of player:
    #addcoins to {fight.%victim%}

Si le joueur fuit et meurt plus tard par exemple 1 minutes plus tard.

L'autre gagne quand même 😕

Il faudrait delete la var. Mais si on met un wait 5 seconds.

et delete

Il va y avoir un problème nn ?

Je sais pas trop comment faire 😕

 

 

  • 0
Posté(e)
on damage of player:
	attacker is a player
	victim is a player
	set {attacker::%{_victim}%} to attacker
	wait 10 seconds
	clear {attacker::%{_victim}%}

on death of player:
	if attacker or victim is not in world "lobby":
		if attacker is set:
			set {_attacker} to attacker
		else:
			set {_attacker} to {attacker::%{_victim}%}
		send "&a+1.0" to {_attacker}
		add 1 to {_attacker}'s balance
		send "&cVous êtes mort(e) contre %attacker%" to victim
		send "&aVous venez de détruire %victim% !" to {_attacker}
		clear {attacker::%{_victim}%}

 

  • 0
Posté(e)
Le 14/10/2019 à 21:42, Romitou a dit :

on damage of player:
	attacker is a player
	victim is a player
	set {attacker::%{_victim}%} to attacker
	wait 10 seconds
	clear {attacker::%{_victim}%}

on death of player:
	if attacker or victim is not in world "lobby":
		if attacker is set:
			set {_attacker} to attacker
		else:
			set {_attacker} to {attacker::%{_victim}%}
		send "&a+1.0" to {_attacker}
		add 1 to {_attacker}'s balance
		send "&cVous êtes mort(e) contre %attacker%" to victim
		send "&aVous venez de détruire %victim% !" to {_attacker}
		clear {attacker::%{_victim}%}

 

Merci ça marche. 

Mais juste un problème avec ça 

Citation
add 1 to {royalpvp.totalkills::%uuid of {_attacker}%}

J'ai rajouté ça car j'en ai besoin. Mais on peut pas mettre de variables dans le nom de la variable 😕

  • Humm 1
  • 0
Posté(e)
il y a une heure, MissAuthenTiiq a dit :

Merci ça marche. 

Mais juste un problème avec ça 

J'ai rajouté ça car j'en ai besoin. Mais on peut pas mettre de variables dans le nom de la variable 😕

Normalement ça fonctionne, tu as quelle erreur ?

  • 0
Posté(e)
Il y a 15 heures, Romitou a dit :

Normalement ça fonctionne, tu as quelle erreur ?

Voila l'erreur :

Invalid amount or placement of brackets. Please make sure that each opening bracket has a corresponding closing bracket. (killcash.sk line 32: add 1 to {royalpvp.totalkills::%uuid of {_attacker}%}

  • 0
Posté(e)
Il y a 5 heures, MissAuthenTiiq a dit :

Voila l'erreur :

Invalid amount or placement of brackets. Please make sure that each opening bracket has a corresponding closing bracket. (killcash.sk line 32: add 1 to {royalpvp.totalkills::%uuid of {_attacker}%}

Peux-tu envoyer tout ton code ?

  • 0
Posté(e)
Le 17/10/2019 à 17:03, Romitou a dit :

Peux-tu envoyer tout ton code ?

Citation
on damage of player:
    attacker is a player
    victim is a player
    set {attacker::%{_victim}%} to attacker
    wait 10 seconds
    clear {attacker::%{_victim}%}
 
on death of player:
    if attacker or victim is not in world "lobby":
        if attacker is set:
            set {_attacker} to attacker
        else:
            set {_attacker} to {attacker::%{_victim}%}
        send "&a+1.0" to {_attacker}
        add 1 to {_attacker}'s balance
        add 1 to {royalpvp.totalkills::%uuid of %{_attacker}% %}
        send "&cVous êtes mort(e) contre %{_attacker}%" to victim
        send "&aVous venez de détruire %victim% !" to {_attacker}
        make console execute command "leveladd %{_attacker}% kill"
        clear {attacker::%{_victim}%}

Voila le code

  • 0
Posté(e)
Le 22/10/2019 à 10:05, Kilterra a dit :

Tiens voici ton code modifié :


on damage of player:
    attacker is a player
    victim is a player
    set {attacker::%{_victim}%} to attacker
    wait 10 seconds
    clear {attacker::%victim%}
 
on death of player:
    if attacker or victim is not in world "lobby":
        if attacker is set:
            set {_attacker} to attacker
        else:
            set {_attacker} to {attacker::%victim%}
        send "&a+1.0" to {_attacker}
        add 1 to {_attacker}'s balance
        add 1 to {royalpvp.totalkills::%uuid of {_attacker} %}
        send "&cVous êtes mort(e) contre %{_attacker}%" to victim
        send "&aVous venez de détruire %victim% !" to {_attacker}
        make console execute command "leveladd %{_attacker}% kill"
        clear {attacker::%victim%}

 

Merci de l'aide :)

J'ai une erreur encore :(

Citation

can't understand this condition/effect: add 1 to {royalpvp.totalkills::%uuid of {_attacker} %}

 

  • 0
Posté(e)
Le 24/10/2019 à 13:37, Kilterra a dit :

on damage of player:
    attacker is a player
    victim is a player
    set {attacker::%{_victim}%} to attacker
    wait 10 seconds
    clear {attacker::%victim%}
 
on death of player:
    if attacker or victim is not in world "lobby":
        if attacker is set:
            set {_attacker} to attacker
        else:
            set {_attacker} to {attacker::%victim%}
        send "&a+1.0" to {_attacker}
        add 1 to {_attacker}'s balance
		set {_UUID} to UUID of {_attacker}
        add 1 to {royalpvp.totalkills::%{_UUID}%}
        send "&cVous êtes mort(e) contre %{_attacker}%" to victim
        send "&aVous venez de détruire %victim% !" to {_attacker}
        make console execute command "leveladd %{_attacker}% kill"
        clear {attacker::%victim%}

ça marche ! merci !

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • Créer...

Information importante

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.