Aller au contenu

Skript baton de blaze magique


Messages recommandés

Posté(e)

Bonjour, j'aimerais de l'aide car j'aimerais rajouter 2 nouveau batons magiques exemples :

Un Baton qui fait spawn 1 mur d'obsidian de 6 bloc de haut, en cliquant avec le baton, et il doit disparaitre ou bout de 5 seconde

Un Baton qui fait exploser une tnt (Qui ne detruit pas l'environnement) Juste l'effet l'explosion sans les degats

 

Notre baton existant : (Qui fonctionnent correctement)

 

command /Kryptonfire:

permission: kryptonfire.use

trigger:

give a blaze rod named "&6&l[&3Pouvoir de feu&6&l]" to player

on click:

player is holding a blaze rod named "&6&l[&3Pouvoir de feu&6&l]"

remove 1 blaze rod named "&6&l[&3Pouvoir de feu&6&l]" from player's inventory

set {_loc} to location of targeted block

{_loc} is not set:

set {_loc} to location of targeted entity

loop all blocks in radius 2 around {_loc}:

loop-block is air or 31

set loop-block to fire

wait 1 second

loop all blocks in radius 2 around {_loc}:

loop-block is fire

set loop-block to air

on left click holding a sign:

message "%targeted block%"

Posté(e)

Mets ton code entre balise :)

 

command /Kryptonexplode:
   permission: explode.use
   trigger:
       give a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" to player

on click:
   player is holding a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]"
   remove 1 blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" from player's inventory
   create a fake explosion player-location

Pour la fake explosion. J'ai pas pu tester je suis sur tel :)

Posté(e)
Je pense que tu as oublié un petit "at"

Style:

create a fake explosion at player-location (ou location of player)

bah je pensais aussi, mais sur SkUnity y'a marqué ca ^^

[(create|make)] [a] fake explosion [%directions% %locations%]

donc y'a pas le "at" !

Posté(e)
Oui mais la %location% comporte le at xD

ahhh ok xDD c'est bizarre, parce que quand tu affiches une location, il y a juste marqué "x:num y:num z:num" pas "at x machin"...

 

Mais merci quand même :p

Posté(e)

Bonjour donc votre skript comporte une erreur au niveau de la ligne 9 je croix, et le baton ne fonctionnent pas il fait aucun effet

:/, et pour mon mur d'obsidian ça serais possible svp ?

Posté(e)

Tu as essayé avec le "at" ?

command /Kryptonexplode:
   permission: explode.use
   trigger:
       give a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" to player

on click:
   player is holding a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]"
   remove 1 blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" from player's inventory
   create a fake explosion at player-location

Et pour le mur d'obsidienne, je suis en train de voir ^^

 

EDIT : J'avoue avoir besoin d'aide :)

 

command /wall:
   permission: wall.use
   trigger:
       give a blaze rod named "&6&l[&3Pouvoir de protection&6&l]" to player

on click:
   if player is holding a blaze rod named "&6&l[&3Pouvoir de protection&6&l]":
       cancel event
       if the horizontal facing of player is east:
           set {_pos1} to player's location
           add 3 to x-loc of {_pos1}
           remove 3 from z-loc of {_pos1}
           set {_pos2} to {_pos1}
           add 6 to z-loc of {_pos2}
           add 6 to y-loc of {_pos2}
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               set {_lb.%{_li}%} to loop-block
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               set loop-block to obsidian
               add 1 to {_li}
           wait 5 seconds
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               loop-block is obsidian
               set loop-block to {_lb.%{_li}%} #<===========
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               add 1 to {_li}

       else if the horizontal facing of player is west:
           set {_pos1} to player's location
           remove 3 from x-loc of {_pos1}
           add 3 to z-loc of {_pos1}
           set {_pos2} to {_pos1}
           remove 6 from z-loc of {_pos2}
           add 6 to y-loc of {_pos2}
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               set {_lb.%{_li}%} to loop-block
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               set loop-block to obsidian
               add 1 to {_li}
           wait 5 seconds
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               loop-block is obsidian
               set loop-block to {_lb.%{_li}%} #<===========
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               add 1 to {_li}

       else if the horizontal facing of player is north:
           set {_pos1} to player's location
           remove 3 from z-loc of {_pos1}
           add 3 to x-loc of {_pos1}
           set {_pos2} to {_pos1}
           remove 6 from x-loc of {_pos2}
           add 6 to y-loc of {_pos2}
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               set {_lb.%{_li}%} to loop-block
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               set loop-block to obsidian
               add 1 to {_li}
           wait 5 seconds
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               loop-block is obsidian
               set loop-block to {_lb.%{_li}%} #<===========
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               add 1 to {_li}



       else if the horizontal facing of player is south:
           set {_pos1} to player's location
           add 3 to z-loc of {_pos1}
           remove 3 from x-loc of {_pos1}
           set {_pos2} to {_pos1}
           add 6 to x-loc of {_pos2}
           add 6 to y-loc of {_pos2}
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               set {_lb.%{_li}%} to loop-block
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               set loop-block to obsidian
               add 1 to {_li}
           wait 5 seconds
           set {_li} to 0
           loop blocks within {_pos1} to {_pos2}:
               loop-block is obsidian
               set loop-block to {_lb.%{_li}%} #<===========
               broadcast "&c%{_li}% &8: &6%{_lb.%{_li}%}%"
               add 1 to {_li}

 

Je ne sais pas si c'est la manière la plus optimisé, mais ca prend pas trop de ressources et ca fonctionne :) (la majorité des lignes c'est de simple calcul [+2, -6 etc])

 

Mais j'ai un problème les blocks ne veulent pas s'enlever... Sur les lignes ou j'ai mis "#<========", c'est la que le problème se pose. Au lieu de set le block à la variable, il set la variable au block. Je ne sais pas si vous avez compris mais bon ^^

Je me permet de tag @Anarchick et @Shelk pour m'aider :)

Posté(e)

Bizarre :eek:

Tu peux toujours faire:

make console execute "/setblock %location of loop-block% %{_lb.%{_li}%}%"

ça devrait marcher même si c'est pas opti

 

Edit: Sinon pour le %location% enfaite quand on parle de coordonnées bien sûr pas de "at ..." mais quand on met par exemple "location of player",on est obligé de mettre "at location of player" ^^

Posté(e)
Bizarre :eek:

Tu peux toujours faire:

make console execute "/setblock %location of loop-block% %{_lb.%{_li}%}%"

ça devrait marcher même si c'est pas opti

pas bête, mais ca ne fonctionne pas...

 

J'ai essayer avec le at s'a fonctionnent toujour pas :/

command /Kryptonexplode:
   permission: explode.use
   trigger:
       give a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" to player

on click:
   player is holding a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]"
   remove 1 blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" from player's inventory
   create a fake explosion at player's location

 

my bad :o player-location ca existe pas xD c'est player's location

Posté(e)

Précise ou doit être l'explosion.

Par contre pour les ennemis en l'air,tu peux faire:

create a fake explosion named "BOOM" at player's location

(Remplacer ça par la ligne de code avant)

Puis:

on explosion:
   if name of event-entity is "BOOM":
       loop all players in radius 3 around event-entity:
           push loop-player upwards at force 0.5

Un truc du genre il se peut que le code soit faux.

Par contre ça éjectera aussi le joueur qui l'a mise

Posté(e)
command /Kryptonexplode:
   permission: explode.use
   trigger:
       give a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" to player

on click:
   player is holding a blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]"
   remove 1 blaze rod named "&6&l[&3Pouvoir d'explosion&6&l]" from player's inventory
   create a fake explosion named "Boom" at targeted block

on explosion:
   if name of event-entity is "Boom":
       loop all players in radius 3 around event-entity:
           push loop-player upwards at speed 0.2

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