YML data

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

SpeedBlock

Member
Jan 26, 2017
22
1
0
21
I'm new to creating yml files and I was trying things until I have been forced because I do not pass this part.
Could someone explain it to me and solve it?

Here is the code:

Code:
options:
    prefix: &8[&5Coins&8]
    file: plugins/Coins/data.yml

on load:
    if file "{@file}" does not exist:
        create file "{@file}"

function coins(player: player):
    set {coins::%{_player}%} to skutil yaml value "Coins.players.%{_player}%" from file "{@file}"
    while {coins::%{_player}%} is not set:
        set skutil yaml value "Coins.players.%{_player}%" from file "{@file}" to 0
        set {coins::%{_player}%} to skutil yaml value "Coins.players.%{_player}%" from file "{@file}"
    
command /coins [<text>]:
    trigger:
        if arg 1 is not set:
            coins(player)
            send "{@prefix} &fTus coins: &a%{coins::%{_player}%}%" to player

on mine:
    set skutil yaml value "Coins.players.%{_player}%" from file "{@file}" to {coins::%{_player}%} + 1
    coins(player)
    
on join:
    coins(player)

on first join:
    coins(player)
 

Attachments

  • unknown.png
    unknown.png
    16.2 KB · Views: 168
Status
Not open for further replies.