Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game:GetService("Players").LocalPlayer
- local PlayerGui = Player.PlayerGui
- local HasSpecial = function(string)
- return (string:match("%c") or string:match("%s") or string:match("%p")) ~= nil
- end
- local GetPath = function(Instance)
- local Obj = Instance
- local string = {}
- local temp = {}
- local error = false
- while Obj ~= game do
- if Obj == nil then
- error = true
- break
- end
- table.insert(temp, Obj.Parent == game and Obj.ClassName or tostring(Obj))
- Obj = Obj.Parent
- end
- table.insert(string, "game:GetService(\"" .. temp[#temp] .. "\")")
- for i = #temp - 1, 1, -1 do
- table.insert(string, HasSpecial(temp[i]) and "[\"" .. temp[i] .. "\"]" or "." .. temp[i])
- end
- return (error and "nil -- Path contained an invalid instance" or table.concat(string, ""))
- end
- local Script2File = Instance.new("ScreenGui")
- local Main = Instance.new("Frame")
- local ScriptsFrame = Instance.new("Frame")
- local Scroll = Instance.new("ScrollingFrame")
- local Example = Instance.new("TextButton")
- local UIListLayout = Instance.new("UIListLayout")
- local Ribbon = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local close = Instance.new("TextButton")
- local Decompile = Instance.new("TextButton")
- local Edit = Instance.new("TextButton")
- local EditSource = Instance.new("Frame")
- local Edit_2 = Instance.new("ScrollingFrame")
- local Ed = Instance.new("TextBox")
- local Keywords = Instance.new("TextLabel")
- local Globals = Instance.new("TextLabel")
- local DecompileResult = Instance.new("Frame")
- local DecompileSource = Instance.new("ScrollingFrame")
- local Decompiled = Instance.new("TextLabel")
- local Keywords_2 = Instance.new("TextLabel")
- local Globals_2 = Instance.new("TextLabel")
- local View = Instance.new("TextButton")
- local Copy = Instance.new("TextButton")
- local Clear = Instance.new("TextButton")
- local Apply = Instance.new("TextButton")
- local Save = Instance.new("TextButton")
- --Properties:
- Script2File.Name = "Script2File"
- Script2File.Parent = game.CoreGui
- Script2File.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Main.Name = "Main"
- Main.Parent = Script2File
- Main.Active = true
- Main.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
- Main.Position = UDim2.new(0.0147601496, 0, 0.0226843096, 0)
- Main.Size = UDim2.new(0, 748, 0, 410)
- ScriptsFrame.Name = "ScriptsFrame"
- ScriptsFrame.Parent = Main
- ScriptsFrame.BackgroundColor3 = Color3.new(1, 1, 1)
- ScriptsFrame.BackgroundTransparency = 1
- ScriptsFrame.Position = UDim2.new(0, 0, 0.0658536553, 0)
- ScriptsFrame.Size = UDim2.new(0, 266, 0, 383)
- Scroll.Name = "Scroll"
- Scroll.Parent = ScriptsFrame
- Scroll.BackgroundColor3 = Color3.new(1, 1, 1)
- Scroll.BackgroundTransparency = 1
- Scroll.Size = UDim2.new(1, 0, 1, 0)
- Scroll.BottomImage = "rbxassetid://148970562"
- Scroll.MidImage = "rbxassetid://148970562"
- Scroll.TopImage = "rbxassetid://148970562"
- Example.Name = "Example"
- Example.Parent = Scroll
- Example.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
- Example.Position = UDim2.new(0.0451127812, 0, 0.02610966, 0)
- Example.Size = UDim2.new(0, 222, 0, 26)
- Example.Visible = false
- Example.Font = Enum.Font.SourceSans
- Example.Text = "example"
- Example.TextColor3 = Color3.new(1, 1, 1)
- Example.TextSize = 16
- UIListLayout.Parent = ScriptsFrame
- Ribbon.Name = "Ribbon"
- Ribbon.Parent = Main
- Ribbon.Active = true
- Ribbon.BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431)
- Ribbon.Size = UDim2.new(0, 748, 0, 27)
- TextLabel.Parent = Ribbon
- TextLabel.BackgroundColor3 = Color3.new(0, 0, 0)
- TextLabel.BackgroundTransparency = 1
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = "S2F"
- TextLabel.TextColor3 = Color3.new(1, 1, 1)
- TextLabel.TextSize = 22
- close.Name = "close"
- close.Parent = Ribbon
- close.BackgroundColor3 = Color3.new(1, 0.215686, 0.254902)
- close.Position = UDim2.new(0.946524084, 0, 0, 0)
- close.Size = UDim2.new(0, 40, 0, 27)
- close.Font = Enum.Font.SourceSans
- close.Text = "_"
- close.TextColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- close.TextSize = 18
- Decompile.Name = "Decompile"
- Decompile.Parent = Main
- Decompile.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Decompile.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
- Decompile.Position = UDim2.new(0.366310149, 0, 0.0829268321, 0)
- Decompile.Size = UDim2.new(0, 158, 0, 28)
- Decompile.Font = Enum.Font.SourceSansBold
- Decompile.Text = "DECOMPILE SCRIPT"
- Decompile.TextColor3 = Color3.new(0.14902, 1, 0.247059)
- Decompile.TextSize = 18
- Decompile.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
- Edit.Name = "Edit"
- Edit.Parent = Main
- Edit.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Edit.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
- Edit.Position = UDim2.new(0.637700558, 0, 0.0829268321, 0)
- Edit.Size = UDim2.new(0, 158, 0, 28)
- Edit.Font = Enum.Font.SourceSansBold
- Edit.Text = "EDIT SCRIPT"
- Edit.TextColor3 = Color3.new(0.14902, 1, 0.247059)
- Edit.TextSize = 18
- Edit.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
- EditSource.Name = "EditSource"
- EditSource.Parent = Main
- EditSource.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- EditSource.ClipsDescendants = true
- EditSource.Position = UDim2.new(0.366310149, 0, 0.185365856, 0)
- EditSource.Size = UDim2.new(0, 466, 0, 291)
- EditSource.Visible = false
- Edit_2.Name = "Edit"
- Edit_2.Parent = EditSource
- Edit_2.BackgroundColor3 = Color3.new(1, 1, 1)
- Edit_2.BackgroundTransparency = 1
- Edit_2.Size = UDim2.new(0, 466, 0, 316)
- Edit_2.BottomImage = "rbxassetid://148970562"
- Edit_2.MidImage = "rbxassetid://148970562"
- Edit_2.TopImage = "rbxassetid://148970562"
- Ed.Name = "Ed"
- Ed.Parent = Edit_2
- Ed.BackgroundColor3 = Color3.new(1, 1, 1)
- Ed.BackgroundTransparency = 1
- Ed.Size = UDim2.new(1, 0, 1, 0)
- Ed.ClearTextOnFocus = false
- Ed.Font = Enum.Font.SourceSans
- Ed.MultiLine = true
- Ed.Text = ""
- Ed.TextColor3 = Color3.new(0.654902, 0.654902, 0.654902)
- Ed.TextSize = 18
- Ed.TextXAlignment = Enum.TextXAlignment.Left
- Ed.TextYAlignment = Enum.TextYAlignment.Top
- Keywords.Name = "Keywords"
- Keywords.Parent = Ed
- Keywords.BackgroundColor3 = Color3.new(1, 1, 1)
- Keywords.BackgroundTransparency = 1
- Keywords.Size = UDim2.new(1, 0, 1, 0)
- Keywords.Font = Enum.Font.SourceSans
- Keywords.Text = " "
- Keywords.TextColor3 = Color3.new(1, 0, 0.0156863)
- Keywords.TextSize = 18
- Keywords.TextXAlignment = Enum.TextXAlignment.Left
- Globals.Name = "Globals"
- Globals.Parent = Ed
- Globals.BackgroundColor3 = Color3.new(1, 1, 1)
- Globals.BackgroundTransparency = 1
- Globals.Size = UDim2.new(1, 0, 1, 0)
- Globals.Font = Enum.Font.SourceSans
- Globals.Text = " "
- Globals.TextColor3 = Color3.new(0, 1, 0)
- Globals.TextSize = 18
- Globals.TextXAlignment = Enum.TextXAlignment.Left
- DecompileResult.Name = "DecompileResult"
- DecompileResult.Parent = Main
- DecompileResult.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- DecompileResult.ClipsDescendants = true
- DecompileResult.Position = UDim2.new(0.366310149, 0, 0.185365856, 0)
- DecompileResult.Size = UDim2.new(0, 466, 0, 291)
- DecompileSource.Name = "DecompileSource"
- DecompileSource.Parent = DecompileResult
- DecompileSource.BackgroundColor3 = Color3.new(1, 1, 1)
- DecompileSource.BackgroundTransparency = 1
- DecompileSource.Size = UDim2.new(0, 466, 0, 316)
- DecompileSource.BottomImage = "rbxassetid://148970562"
- DecompileSource.CanvasPosition = Vector2.new(0, 0.285500526)
- DecompileSource.MidImage = "rbxassetid://148970562"
- DecompileSource.TopImage = "rbxassetid://148970562"
- Decompiled.Name = "Decompiled"
- Decompiled.Parent = DecompileSource
- Decompiled.BackgroundColor3 = Color3.new(1, 1, 1)
- Decompiled.BackgroundTransparency = 1
- Decompiled.Size = UDim2.new(1, 0, 1, 0)
- Decompiled.Font = Enum.Font.SourceSans
- Decompiled.Text = " "
- Decompiled.TextColor3 = Color3.new(0.737255, 0.737255, 0.737255)
- Decompiled.TextSize = 18
- Decompiled.TextXAlignment = Enum.TextXAlignment.Left
- Keywords_2.Name = "Keywords"
- Keywords_2.Parent = Decompiled
- Keywords_2.BackgroundColor3 = Color3.new(1, 1, 1)
- Keywords_2.BackgroundTransparency = 1
- Keywords_2.Size = UDim2.new(1, 0, 1, 0)
- Keywords_2.Font = Enum.Font.SourceSans
- Keywords_2.Text = " "
- Keywords_2.TextColor3 = Color3.new(1, 0, 0.0156863)
- Keywords_2.TextSize = 18
- Keywords_2.TextXAlignment = Enum.TextXAlignment.Left
- Globals_2.Name = "Globals"
- Globals_2.Parent = Decompiled
- Globals_2.BackgroundColor3 = Color3.new(1, 1, 1)
- Globals_2.BackgroundTransparency = 1
- Globals_2.Size = UDim2.new(1, 0, 1, 0)
- Globals_2.Font = Enum.Font.SourceSans
- Globals_2.Text = " "
- Globals_2.TextColor3 = Color3.new(0, 1, 0)
- Globals_2.TextSize = 18
- Globals_2.TextXAlignment = Enum.TextXAlignment.Left
- View.Name = "View"
- View.Parent = Main
- View.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- View.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
- View.Position = UDim2.new(0.871657729, 0, 0.0829268321, 0)
- View.Size = UDim2.new(0, 74, 0, 28)
- View.Font = Enum.Font.SourceSansBold
- View.Text = "VIEW"
- View.TextColor3 = Color3.new(0.14902, 1, 0.247059)
- View.TextSize = 18
- View.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
- Copy.Name = "Copy"
- Copy.Parent = Main
- Copy.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Copy.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Copy.Position = UDim2.new(0.490641713, 0, 0.914634168, 0)
- Copy.Size = UDim2.new(0, 90, 0, 28)
- Copy.Visible = false
- Copy.Font = Enum.Font.SourceSansBold
- Copy.Text = "COPY"
- Copy.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Copy.TextSize = 18
- Copy.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- Clear.Name = "Clear"
- Clear.Parent = Main
- Clear.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Clear.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Clear.Position = UDim2.new(0.85799998, 0, 0.915000021, 0)
- Clear.Size = UDim2.new(0, 97, 0, 28)
- Clear.Visible = false
- Clear.Font = Enum.Font.SourceSansBold
- Clear.Text = "CLEAR"
- Clear.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Clear.TextSize = 18
- Clear.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- Apply.Name = "Apply"
- Apply.Parent = Main
- Apply.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Apply.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Apply.Position = UDim2.new(0.741978586, 0, 0.914634168, 0)
- Apply.Size = UDim2.new(0, 80, 0, 28)
- Apply.Visible = false
- Apply.Font = Enum.Font.SourceSansBold
- Apply.Text = "APPLY"
- Apply.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- Apply.TextSize = 18
- Apply.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- Save.Name = "Save"
- Save.Parent = Main
- Save.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
- Save.BorderColor3 = Color3.new(0.745098, 0, 0)
- Save.Position = UDim2.new(0.624331594, 0, 0.914634168, 0)
- Save.Size = UDim2.new(0, 79, 0, 28)
- Save.Visible = false
- Save.Font = Enum.Font.SourceSansBold
- Save.Text = "SAVE"
- Save.TextColor3 = Color3.new(0.745098, 0, 0)
- Save.TextSize = 18
- Save.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- local Highlight = function(string, keywords)
- local K = {}
- local S = string
- local Token =
- {
- ["="] = true,
- ["."] = true,
- [","] = true,
- ["("] = true,
- [")"] = true,
- ["["] = true,
- ["]"] = true,
- ["{"] = true,
- ["}"] = true,
- [":"] = true,
- ["*"] = true,
- ["/"] = true,
- ["+"] = true,
- ["-"] = true,
- ["%"] = true,
- [";"] = true,
- ["~"] = true
- }
- for i, v in pairs(keywords) do
- K[v] = true
- end
- S = S:gsub(".", function(c)
- if Token[c] ~= nil then
- return "\32"
- else
- return c
- end
- end)
- S = S:gsub("%S+", function(c)
- if K[c] ~= nil then
- return c
- else
- return (" "):rep(#c)
- end
- end)
- return S
- end
- local hTokens = function(string)
- local Token =
- {
- ["="] = true,
- ["."] = true,
- [","] = true,
- ["("] = true,
- [")"] = true,
- ["["] = true,
- ["]"] = true,
- ["{"] = true,
- ["}"] = true,
- [":"] = true,
- ["*"] = true,
- ["/"] = true,
- ["+"] = true,
- ["-"] = true,
- ["%"] = true,
- [";"] = true,
- ["~"] = true
- }
- local A = ""
- string:gsub(".", function(c)
- if Token[c] ~= nil then
- A = A .. c
- elseif c == "\n" then
- A = A .. "\n"
- elseif c == "\t" then
- A = A .. "\t"
- else
- A = A .. "\32"
- end
- end)
- return A
- end
- local strings = function(string)
- local highlight = ""
- local quote = false
- string:gsub(".", function(c)
- if quote == false and c == "\"" then
- quote = true
- elseif quote == true and c == "\"" then
- quote = false
- end
- if quote == false and c == "\"" then
- highlight = highlight .. "\""
- elseif c == "\n" then
- highlight = highlight .. "\n"
- elseif c == "\t" then
- highlight = highlight .. "\t"
- elseif quote == true then
- highlight = highlight .. c
- elseif quote == false then
- highlight = highlight .. "\32"
- end
- end)
- return highlight
- end
- local comments = function(string)
- local ret = ""
- string:gsub("[^\r\n]+", function(c)
- local comm = false
- local i = 0
- c:gsub(".", function(n)
- i = i + 1
- if c:sub(i, i + 1) == "--" then
- comm = true
- end
- if comm == true then
- ret = ret .. n
- else
- ret = ret .. "\32"
- end
- end)
- ret = ret
- end)
- return ret
- end
- Main.Draggable = true
- Globals.TextSize = 15
- Globals.Font = 'Code'
- Keywords.TextSize = 15
- Keywords.Font = 'Code'
- Globals_2.TextSize = 15
- Globals_2.Font = 'Code'
- Keywords_2.TextSize = 15
- Keywords_2.Font = 'Code'
- Ed.TextSize = 15
- Ed.Font = 'Code'
- Decompiled.TextSize = 15
- Decompiled.Font = 'Code'
- local Selected = nil
- Script2File.ResetOnSpawn = false
- local lua_keywords = {"and", "break", "do", "else", "elseif", "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while"}
- local global_env = {"getrawmetatable", "game", "workspace", "script", "math", "string", "table", "print", "wait", "BrickColor", "Color3", "next", "pairs", "ipairs", "select", "unpack", "Instance", "Vector2", "Vector3", "CFrame", "Ray", "UDim2", "Enum", "assert", "error", "warn", "tick", "loadstring", "_G", "shared", "getfenv", "setfenv", "newproxy", "setmetatable", "getmetatable", "os", "debug", "pcall", "ypcall", "xpcall", "rawequal", "rawset", "rawget", "tonumber", "tostring", "type", "typeof", "_VERSION", "coroutine", "delay", "require", "spawn", "LoadLibrary", "settings", "stats", "time", "UserSettings", "version", "Axes", "ColorSequence", "Faces", "ColorSequenceKeypoint", "NumberRange", "NumberSequence", "NumberSequenceKeypoint", "gcinfo", "elapsedTime", "collectgarbage", "PhysicalProperties", "Rect", "Region3", "Region3int16", "UDim", "Vector2int16", "Vector3int16"}
- function Highlight_Source()
- Globals.Text = Highlight(Ed.Text,global_env)
- Keywords.Text = Highlight(Ed.Text,lua_keywords)
- Globals_2.Text = Highlight(Decompiled.Text,global_env)
- Keywords_2.Text = Highlight(Decompiled.Text,lua_keywords)
- strings(Decompiled.Text)
- strings(Ed.Text)
- comments(Ed.Text)
- comments(Decompiled.Text)
- DecompileSource.CanvasSize = UDim2.new(0,0,0,20000)
- end
- function Switch_()
- DecompileResult.Visible=false
- EditSource.Visible=true
- Copy.Visible = false
- Apply.Visible = true
- Save.Visible = false
- Copy.Visible = false
- Clear.Visible = true
- end
- function sw2()
- DecompileResult.Visible=true
- EditSource.Visible=false
- Copy.Visible = true
- Apply.Visible = false
- Save.Visible = true
- Clear.Visible = false
- end
- closed = false
- function SaveToLocalFile()
- local j = "--Decompiled by R2F\n"
- local jj = "--Created by tollepuxis\n"
- local jjj = "--Script path: ".. GetPath(Selected).."\n"
- local k = j..jj..jjj
- local ffs = decompile(Selected)
- local hfd = k.. ffs
- writefile("//DecompiledScripts/".. Selected.Name.. ".lua",hfd,defaults)
- end
- function Close()
- if closed==false then
- closed = true
- Main.ClipsDescendants = true
- Main:TweenSize(UDim2.new(0,748,0,27),'InOut','Quint',.4)
- DecompileResult.Visible = false
- EditSource.Visible = false
- ScriptsFrame.Visible = false
- Decompile.Visible = false
- Edit.Visible = false
- View.Visible = false
- Copy.Visible = false
- Save.Visible = false
- else
- closed = false
- Main:TweenSize(UDim2.new(0,748,0,410),'InOut','Quint',.4)
- wait(.41)
- DecompileResult.Visible = true
- EditSource.Visible = false
- ScriptsFrame.Visible = true
- Decompile.Visible = true
- Edit.Visible = true
- Main.ClipsDescendants = false
- View.Visible = true
- end
- end
- Apply.MouseButton1Click:Connect(function()
- loadstring(Ed.Text)()
- end)
- Decompile.MouseButton1Click:Connect(function()
- Decompiled.Text = "Decompiling, please wait..."
- local rfdd = decompile(Selected)
- local j = "--Decompiled by R2F\n"
- local jj = "--Created by tollepuxis\n"
- local jjj = "--Script path: ".. GetPath(Selected).."\n"
- local k = j..jj..jjj
- Decompiled.Text = ''
- Ed.Text = ''
- Decompiled.Text = k.. rfdd
- Highlight_Source()
- end)
- Globals.TextYAlignment = 'Top'
- Globals_2.TextYAlignment = 'Top'
- Keywords.TextYAlignment = 'Top'
- Keywords_2.TextYAlignment = 'Top'
- Ed.Changed:Connect(Highlight_Source)
- Edit.MouseButton1Click:Connect(Switch_)
- View.MouseButton1Click:Connect(sw2)
- close.MouseButton1Click:Connect(Close)
- --getting all the locals and modules
- local modules, locals = {},{}
- function Scan(obj)
- for i,v in pairs(obj) do
- if v:IsA("ModuleScript") then
- table.insert(modules,v)
- elseif v:isA("LocalScript") then
- table.insert(locals,v)
- end
- Scan(v:GetChildren())
- end
- end
- Scan(workspace:GetChildren())
- Scan(game:GetService("ReplicatedStorage"):GetChildren())
- Scan(Player:GetChildren())
- for f,x in pairs(modules) do
- local new = Example:Clone()
- new.Visible = true
- new.Parent = Scroll
- new.Text = x.Name
- new.Position = UDim2.new(0,0,0,f * 30)
- new.MouseButton1Click:Connect(function()
- Selected = x
- end)
- end
- for f,x in pairs(locals) do
- local new = Example:Clone()
- new.Visible = true
- new.Parent = Scroll
- new.Text = x.Name
- new.Position = UDim2.new(0,0,0,f * 30)
- new.MouseButton1Click:Connect(function()
- Selected = x
- end)
- end
- Ed.TextYAlignment = 'Top'
- Decompiled.TextYAlignment = 'Top'
- sw2()
- Clear.MouseButton1Click:Connect(function()
- Ed.Text = ''
- end)
- Copy.MouseButton1Click:Connect(function()
- setclipboard(Decompiled.Text)
- end)
- Save.MouseButton1Click:Connect(SaveToLocalFile)
- DecompileSource.CanvasSize = UDim2.new(0,0,0,20000)
- Edit_2.CanvasSize = UDim2.new(0,0,0,20000)
- Scroll.CanvasSize = UDim2.new(0,0,0,20000)
- Apply.Text = 'EXECUTE'
- Edit.Text = "EXECUTION"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement