Solved Write name of player to value in YAML file

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Lupe

Member
Jun 24, 2017
15
0
0
23
Hi, i have question - how i can write Player´s name to value in YAML file?
Here is my Skript
Code:
on load:
 if folder "plugins/Arcades/" doesn't exists:
  create folder "plugins/Arcades"
 if file "plugins/Arcades/config.yml" doesn't exists:
  create file "plugins/Arcades/config.yml"
  set "Minigames.sheeps" to "true" in yaml file "plugins/Arcades/config.yml"
  set "Minigames.eggcatch" to "true" in yaml file "plugins/Arcades/config.yml"
  set "Minigames.dropfood" to "true" in yaml file "plugins/Arcades/config.yml"
  set "Minigames.buildit" to "true" in yaml file "plugins/Arcades/config.yml"
  set "Options.prefix" to "&0&l[&b&lArcades&0&l]" in yaml file "plugins/Arcades/config.yml"
 if folder "plugins/Arcades/arenas" doesn't exists:
  create folder "plugins/Arcades/arenas"
 if folder "plugins/Arcades/lang" doesn't exists:
  create folder "plugins/Arcades/lang"
 if file "plugins/Arcades/lang/en.yml" doesn't exists:
  create file "plugins/Arcades/lang/en.yml"
  set "game_is_full" to "The game is full!" in yaml file "plugins/Arcades/lang/en.yml"
  set "game_is_already_running" to "Game is already running!" in yaml file "plugins/Arcades/lang/en.yml"
  set "game_is_disabled" to "Game is disabled!" in yaml file "plugins/Arcades/lang/en.yml"
  set {gamerunning} to value "game_is_already_running" get of "plugins/Arcades/lang/en.yml"
  set {gamedisabled} to value "game_is_disabled" get of "plugins/Arcades/lang/en.yml"
  set {gameisfull} to value "game_is_full" get of "plugins/Arcades/lang/en.yml"
 if folder "plugins/Arcades/minigames" doesn't exists:
  create folder "plugins/Arcades/minigames"
 if file "plugins/Arcades/minigames/sheeps.yml" doesn't exists:
  create file "plugins/Arcades/minigames/sheeps.yml"
  set "Options.mission" to "drop" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.amount" to "30" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.give" to "30" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.time" to "60" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.players_killed" to "2" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.maxhp" to "5" in yaml file "plugins/Arcades/minigames/dropfood.yml"
  set "Options.command" to "/give 297 1" in yaml file "plugins/Arcades/minigames/dropfood.yml"
 if file "plugins/Arcades/minigames/eggcatch.yml" doesn't exists:
  create file "plugins/Arcades/minigames/eggcatch.yml"
 if file "plugins/Arcades/minigames/dropfood.yml" doesn't exists:
  create file "plugins/Arcades/minigames/dropfood.yml"
 if file "plugins/Arcades/minigames/buildit.yml" doesn't exists:
  create file "plugins/Arcades/minigames/buildit.yml"
But i want that here will be write
Code:
  set "Options.command" to "/give 297 1" in yaml file "plugins/Arcades/minigames/dropfood.yml"
player´s name - so i want to it will execute command "give %player% 297 1"
How I can set %player% here?
This is default command that will be execute
P.S: sorry for my English, I am from the Czech Republic :emoji_grinning: I hope that you understand me
[doublepost=1498374848,1498339041][/doublepost]Solved, I used
Code:
on join:
 set {_join} to {playerjoin}
 replace all "<player>" with "%player%" in {_join}
 set the join message to "%{_join}%"
And now I can use <player> in config
 
Status
Not open for further replies.