Universal Script ๐Ÿ“Œ
16.8k Views
167 Executions

Format Lua Script

Universal Script ๐Ÿ“Œ
Kkk1_
Kkk1_Published 10
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Open Source Format Lua Script:D It Will More Effectively In glot.io DO NOT USE IT IN ROBLOX APP BECAUSE you just waste your time for can't see printed script cuz it in dev console BTW I Will Upload My Mobile Console Gui(It Obfuscated Btw)

Updates

  1. Script edited: Create script

View Raw
local function FormatScript(Script)
    local Formatted = ""
    local IndentLevel = 0
    local IndentSize = 4
    local InComment = false
    
    for Line in Script:gmatch("([^\r\n]+)") do
        local TrimmedLine = Line:gsub("^%s*(.-)%s*$", "%1")
        
        if TrimmedLine:find("^%-%-") then
            Formatted = Formatted .. string.rep(" ", IndentLevel * IndentSize) .. TrimmedLine .. "\n"
        elseif TrimmedLine:find("end") then
            IndentLevel = IndentLevel - 1
            Formatted = Formatted .. string.rep(" ", IndentLevel * IndentSize) .. TrimmedLine .. "\n"
        elseif TrimmedLine:find("function") or TrimmedLine:find("do") or TrimmedLine:find("then") then
            Formatted = Formatted .. string.rep(" ", IndentLevel * IndentSize) .. TrimmedLine .. "\n"
            IndentLevel = IndentLevel + 1
        else
            Formatted = Formatted .. string.rep(" ", IndentLevel * IndentSize) .. TrimmedLine .. "\n"
        end
    end
    
    return Formatted
end

local Script = [[
local Lmao = true

if Lmao then
print"Lmao"
Lmao = not Lmao
end
]]

print(FormatScript(Script))


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
199.0k
2.2M
Bumped 2 hours ago
Key System

Script hub

#23 this week

Verified script badgeAirflow HUB

Script hub
22.4k
4.5k
Bumped 5 hours ago
Key System
Paid
High Qualityย Offering
Script hub
3.6M
882.8k
Bumped 6 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeFlow Hub | 73 Games | Updated

Script hub
13.5k
25.5k
Bumped 7 hours ago
Script hub
196
440
Approved 8 hours ago
Script hub
2.0M
2.4M
Bumped 8 hours ago
Key System
Universal Script ๐Ÿ“Œ
125
48
Approved 8 hours ago
Paid