if file "x" doesn't exist, Do not work...

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

Laukage

Member
Skript Version: Skript (dev34)
Skript Author: Bensku
Minecraft Version: 1.12.2

Hello i've been trying for while to get this working but i can't seem to find the problem, my problem is i want to check a file and if it doesn't exist it will create a player file... and if it does do something else but it always chooses the "else" even when the file doesn't exist...

i think i know the problem but i can't seem to find a solution for it on the forums.. i want to check a file in a folder out where the spigot.jar is.

My code:
https://pastebin.com/hP23Ab6v


Have you tried searching the docs? Yes - and tried every single syntax i could find...
Have you tried searching the forums? Yes, alot but after they changed to the new forum the search engine has become shit.. so it pretty hard to find things you need.
What other methods have you tried to fix it? i've tried every single syntax to check files...
 
Try to put it that way.

code_language.skript:
if file "DATABASE/Spillere/%uuid of player%.yml" doesn't exist:
            send player title "&bVelkommen, &7%player%!" with subtitle "&7Husk at læse vores &c/regler" for 6 seconds
            create file "DATABASE/Spillere/%uuid of player%.yml"
            set yaml value "IGN" from file "DATABASE/Spillere/%uuid of player%.yml" to "%player%"
        else:
            set {_IGN} to yaml value "IGN" from file "DATABASE/Spillere/%uuid of player%.yml"
            if {_IGN} is "%player%":
                stop
    else:
        set yaml value "IGN" from file "DATABASE/Spillere/%uuid of player%.yml" to "%player%"
 
Status
Not open for further replies.