Aller au contenu
  • 0

"Location" dans un fichier YML


Question

Posté(e)

Bonjour, bonjour

 

Toujours dans ma grande folies des fichiers YML j'ai voulu stocker une "location" dans le fichier MAIS évidement ça ne marche pas...

[spoiler=CODE COMMANDE]

command /setloc:
   trigger:
       set yaml value "loc" from file "Ville.yml" to "%location of player%"
       message "Loc définit en: %location of player%"

command /loc:
   trigger:
       set {_loc} to single value "loc" get of "plugins/Skript/scripts/Ville.yml"
       teleport player to {_loc}
       message "Téléportation!" 

[spoiler=FICHIER YML]

loc: 'x: -125.87, y: 65.56, z: 277.02'

 

 

 

Aucune erreur au "reload" mais quand je fais "/loc" je ne me fais pas téléporter. J'ai essayer de "parser" la variable en "location" mes ça me fait des errurs. Je demandes donc si il est possible de rendre ma commande "/loc" fonctionnel.

 

Merci de m'avoir lu !!!

6 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Il va falloir passer autrement. Une location dans un fichier YML, a tendance à s'enregistrer comme ça :

 

Loc: # Nom de ta location (je prends la tienne).
 X: 0 # X.
 Y: 64 # Y.
 Z: 0 # Z.
 World: Lobby # Nom du monde où se trouve la location.

 

Du coup on va faire comme ceci :

 

(J'utilise le YML de SkUtilities qui est mieux) :

 

command /setloc:
   trigger:
       set yml value "Loc.X" of file "plugins/Skript/scripts/Villes.yml" to x-pos of player
       set yml value "Loc.Y" of file "plugins/Skript/scripts/Villes.yml" to y-pos of player
       set yml value "Loc.Z" of file "plugins/Skript/scripts/Villes.yml" to z-pos of player
       set yml value "Loc.World" of file "plugins/Skript/scripts/Villes.yml" to "%player's world%"
       send "Location définie !"

command /loc:
   trigger:
       set {_x} to yml value "Loc.X" of file "plugins/Skript/scripts/Villes.yml"
       set {_y} to yml value "Loc.Y" of file "plugins/Skript/scripts/Villes.yml"
       set {_z} to yml value "Loc.Z" of file "plugins/Skript/scripts/Villes.yml"
       set {_world} to yml value "Loc.World" of file "plugins/Skript/scripts/Villes.yml"
       teleport player to position {_x}, {_y}, {_z}, of the world {_world}

  • 0
Posté(e)
Merci de ta réponse mais quand je reload ça me mets cette erreur:

MftVMXK.png

command /setloc:
   trigger:
       set yml value "Loc.X" of file "plugins/Skript/scripts/Villes.yml" to x-pos of player
       set yml value "Loc.Y" of file "plugins/Skript/scripts/Villes.yml" to y-pos of player
       set yml value "Loc.Z" of file "plugins/Skript/scripts/Villes.yml" to z-pos of player
       set yml value "Loc.World" of file "plugins/Skript/scripts/Villes.yml" to "%player's world%"
       send "Location définie !"

command /loc:
   trigger:
       set {_x} to yml value "Loc.X" of file "plugins/Skript/scripts/Villes.yml"
       set {_y} to yml value "Loc.Y" of file "plugins/Skript/scripts/Villes.yml"
       set {_z} to yml value "Loc.Z" of file "plugins/Skript/scripts/Villes.yml"
       set {_world} to yml value "Loc.World" of file "plugins/Skript/scripts/Villes.yml"
       set {_loc} to position {_x}, {_y}, {_z} of the world {_world} parsed as a world
       teleport player to {_loc}

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