Giter Club home page Giter Club logo

json-config-library-for-roblox-lua's Introduction

JSON-Config-Library-for-Roblox-Lua

This makes writing config files way easier than before. Uses HttpService:JSONEncode() and HttpService:JSONDecode() to work.

Documentation:


void WriteConfig( fileName, content)

Writes a JSON config file with the given filename and content which can be read, edited or overwritten.

void ReadConfig( fileName/filePath)

Returns a table from the read config file which you can use as mentioned/given in the example.

bool IsConfig( fileName/filePath)

Returns true if the config exists in the executor's directory, workspace folder (by default) or wherever you've saved it, false if not.

Examples:

WriteConfig()

--Write Config
local lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/AlexDevlpr/JSON-Config-Library-for-Roblox-Lua/main/Library.lua"))()

local example_table = {
    money = 20,
    isbroke = true,
    msg = "This is a example script lol"
}

lib.WriteConfig("example_config", example_table)

--[[
Output: Nothing, It writes a config with the given data.
]]

ReadConfig()

--Read Config

local lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/AlexDevlpr/JSON-Config-Library-for-Roblox-Lua/main/Library.lua"))()

local table_uwu = lib.ReadConfig("example_config")

print("I have $"..tostring(table_uwu.money))
print("I am broke? That is "..tostring(table_uwu.isbroke))
print(table_uwu.msg)

--[[
Output:
I have $20
I am broke? That is true
This is a example script lol
]]

IsConfig()

--Read Config

local lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/AlexDevlpr/JSON-Config-Library-for-Roblox-Lua/main/Library.lua"))()

local configexists = lib.IsConfig("example_config")

print(configexists)

--[[
Output:
true
]]

json-config-library-for-roblox-lua's People

Contributors

ad-devlpr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.