I need help saving locations into a 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.

SpartanDylan7

Member
Nov 27, 2021
4
0
1
20
I am making a gen server from scratch and need help saving a list of locations to a YAML file because everytime I restart the server it no longer will let you pick up the gen. If there's an easier method than a YAML file please do that. Thanks!

Code:
on place:
    if name of player's held item is "&e&lCOAL GEN":
        add location of event-block to {placed::gens::*}
        send "&aYou Have Placed Down A Coal Gen!" to the player
    
on left click:
    if event-block is coal block:
        if {placed::gens::*} contains location of event-block:
            cancel event
            set event-block to air
            remove location of event-block from {placed::gens::*}
            give player glowing coal block named "&e&lCOAL GEN" with lore "&7Output: &aCoal" and "&7Upgrade Price: &a$2,500"
            send "&aYou Have Picked Up A Coal Gen!" to the player
            
every 5 seconds:
    loop all players:
        loop all blocks in radius 30 of loop-player:
            if loop-block is coal block:
                if {placed::gens::*} contains location of loop-value-2:
                drop 1 coal at block above loop-value-2
 
Status
Not open for further replies.