Aller au contenu

Messages recommandés

Posté(e)

Bonjour la communauté Skript-MC !

Aujourd'hui je vous demande un skript : "PvP BOX"

Alors voilà les explications.

 

EXPLICATION:

Je suis entrain de développer un serveur Faction, et j'aimerai intégrer un PvP Box, quand le joueur fait la commande /pvpbox join sa le tp dans un petit hub ou il perd tous son stuff et il peut choisir entre trois kits : Archer / Gladiateur / Sorcier (je le ferai par moi même). Et quand le joueur fait la commande /pvpbox leave il retp à l'endroit ou il avait fait la commande /pvpbox join, et il a de nouveau son stuff de PvP Faction.

Si le joueur ah un kit par exemple Archer sur lui et qui fait la commande /pvpbox leave sa lui enlève son kit archer pour lui remettre le stuff qui l'avait au tous débuts.

Donc voilà, si vous avez pas tous compris, je vous réexpliquerai !

 

Merci d'avance :)

Posté(e)

[spoiler=Voici le script demandé]

command /pvpbox <text>:
   trigger:
       if arg-1 is "join":
           set {inventory.%player%} to player's serialized inventory
           wait 15 ticks
           send "&7[&9PVPBox&7] &aInventaire sauvergardé !"
           clear the player's inventory
           send "&7[&9PVPBox&7] &aTéléportation en cours ..."
           set {back.%player%} to location of player
           teleport player to {pvpbox.tp}
           give 1 chest named "&aChoix du kit &7/pkit [&aGladiateur&7/&aArcher&7/&aSorcier&7]"
           set {drop.%player%} to false
       if arg-1 is "leave":
           teleport player to {back.%player%}
           set {drop.%player%} to true
           clear the player's inventory
           restore inventory of player from {inventory.%player%}
       if arg-1 is "setspawn":
           player has permission "skript.op":
               set {pvpbox.tp} to location of player

on drop:
   {drop.%player%} is false:
       cancel event

on death:
   victim is a player:
       {drop.%player%} is false:
           clear drops

command /pkit <text>:
   trigger:
       {drop.%player%} is false:
           if arg-1 is "gladiateur":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player
           if arg-1 is "archer":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player
           if arg-1 is "sorcier":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player

 

 

Posté(e)

command /pvpbox <text>:
   trigger:
       if arg-1 is "join":
           set {inventory.%player%} to player's serialized inventory
           wait 15 ticks
           send "&7[&9PVPBox&7] &aInventaire sauvergardé !"
           clear the player's inventory
           send "&7[&9PVPBox&7] &aTéléportation en cours ..."
           set {back.%player%} to location of player
           teleport player to {pvpbox.tp}
           give 1 chest named "&aChoix du kit &7/pkit [&aGladiateur&7/&aArcher&7/&aSorcier&7]"
           set {drop.%player%} to false
       if arg-1 is "leave":
           teleport player to {back.%player%}
           set {drop.%player%} to true
           clear the player's inventory
           restore inventory of player from {inventory.%player%}
       if arg-1 is "setspawn":
           player has permission "skript.op":
               set {pvpbox.tp} to location of player

on drop:
   {drop.%player%} is false:
       cancel event

on death:
   victim is a player:
       clear drops

command /pkit <text>:
   trigger:
       {drop.%player%} is false:
           if arg-1 is "gladiateur":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player
           if arg-1 is "archer":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player
           if arg-1 is "sorcier":
               equip player with 1 iron helmet
               equip player with 1 iron chestplate
               equip player with 1 iron leggings
               equip player with 1 iron boots
               give 1 diamond sword to player

 

Heyheyhey! Petite faute! Pour ton on death, met une verification avant de clear les drops '-'.

Posté(e)

Okey, tous est OK ! Merci beaucoup, et dans ton code il y a une erreur :

 

give 1 chest named "&aChoix du kit &7/pkit [&aGladiateur&7/&aArcher&7/&aSorcier&7]"

Tu a oublié le to player ;D

 

Je met en résolu. Encore merci.

Posté(e)
Okey, tous est OK ! Merci beaucoup, et dans ton code il y a une erreur :

 

give 1 chest named "&aChoix du kit &7/pkit [&aGladiateur&7/&aArcher&7/&aSorcier&7]"

Tu a oublié le to player ;D

 

Je met en résolu. Encore merci.

Moi, je dis non :p.

Car si tu fais en multi-monde (Factions + PvpBox sur le meme serveur), bah ton clear drops risque de te faire chier un peu ^^. Je te conseille de faire une vérif de la variable {drops.%player%}

Posté(e)
Moi, je dis non :p.

Car si tu fais en multi-monde (Factions + PvpBox sur le meme serveur), bah ton clear drops risque de te faire chier un peu ^^. Je te conseille de faire une vérif de la variable {drops.%player%}

 

J'ai repris le Skript que @Adriix34 ma donné (Celui qui la modifié y a environ 2/3 minutes).

×
×
  • 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.