1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript file creation help

Discussion in 'Skript' started by egamer3000, Nov 25, 2019.

Thread Status:
Not open for further replies.
  1. egamer3000

    egamer3000 Member

    Joined:
    Nov 25, 2019
    Messages:
    41
    Likes Received:
    8
    Hiya! I'm working on a config for a Skript. How would I make a file contain something?

    Code (Text):
    1.  
    2. on load:
    3.     if file "plugins/Skript/Scripts/sliConfig.sk" doesn't exist:
    4.         create file "plugins/Skript/Scripts/sliConfig.sk" containing(??):
    5.             # blah blah blah        
    6.  
     
  2. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    with skript-mirror 2.0.0:
    Code (Text):
    1.  
    2. import:
    3.     java.io.FileOutputStream
    4.     java.io.OutputStreamWriter
    5.     java.io.BufferedWriter
    6.     java.lang.System
    7.  
    8.     set {_out} to new BufferedWriter(new OutputStreamWriter(new FileOutputStream("/root/serverdirectory/plugins/somefile.txt", true), "UTF-8"))
    9.     set {_newline} to System.getProperty("line.separator")
    10.     loop {_strings::*}:
    11.         {_out}.write("%loop-value%%{_newline}%")
    12.     {_out}.close()
    13.  
     
  3. egamer3000

    egamer3000 Member

    Joined:
    Nov 25, 2019
    Messages:
    41
    Likes Received:
    8

    Thank you!
     
  4. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    314
    Likes Received:
    21
    Code (Skript):
    1. set yml value "spawn_location" of file "plugins/Malia/core/config.yml" to player's location
     
Thread Status:
Not open for further replies.

Share This Page

Loading...