Advertisement
aiden50_70

S2F v1

Mar 4th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.29 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2. local PlayerGui = Player.PlayerGui
  3. local HttpService = game:GetService("HttpService")
  4.  
  5. if is_protosmasher_caller and PROTOSMASHER_LOADED then
  6.  
  7. else
  8.  
  9. end
  10.  
  11. local HasSpecial = function(string)
  12. return (string:match("%c") or string:match("%s") or string:match("%p")) ~= nil
  13. end
  14.  
  15. local GetPath = function(Instance)
  16. local Obj = Instance
  17. local string = {}
  18. local temp = {}
  19. local error = false
  20.  
  21. while Obj ~= game do
  22. if Obj == nil then
  23. error = true
  24. break
  25. end
  26. table.insert(temp, Obj.Parent == game and Obj.ClassName or tostring(Obj))
  27. Obj = Obj.Parent
  28. end
  29.  
  30. table.insert(string, "game:GetService(\"" .. temp[#temp] .. "\")")
  31.  
  32. for i = #temp - 1, 1, -1 do
  33. table.insert(string, HasSpecial(temp[i]) and "[\"" .. temp[i] .. "\"]" or "." .. temp[i])
  34. end
  35.  
  36. return (error and "nil -- Path contained an invalid instance" or table.concat(string, ""))
  37. end
  38.  
  39. local Script2File = Instance.new("ScreenGui")
  40. local Main = Instance.new("Frame")
  41. local ScriptsFrame = Instance.new("Frame")
  42. local Scroll = Instance.new("ScrollingFrame")
  43. local Example = Instance.new("TextButton")
  44. local UIListLayout = Instance.new("UIListLayout")
  45. local Decompile = Instance.new("TextButton")
  46. local Edit = Instance.new("TextButton")
  47. local EditSource = Instance.new("Frame")
  48. local Edit_2 = Instance.new("ScrollingFrame")
  49. local Ed = Instance.new("TextBox")
  50. local Keywords = Instance.new("TextLabel")
  51. local Globals = Instance.new("TextLabel")
  52. local Strings = Instance.new("TextLabel")
  53. local ExploitKeywords = Instance.new("TextLabel")
  54. local _Line = Instance.new("TextLabel")
  55. local DecompileResult = Instance.new("Frame")
  56. local DecompileSource = Instance.new("ScrollingFrame")
  57. local Decompiled = Instance.new("TextLabel")
  58. local Keywords_2 = Instance.new("TextLabel")
  59. local Globals_2 = Instance.new("TextLabel")
  60. local Line = Instance.new("TextLabel")
  61. local View = Instance.new("TextButton")
  62. local Copy = Instance.new("TextButton")
  63. local Clear = Instance.new("TextButton")
  64. local Apply = Instance.new("TextButton")
  65. local Save = Instance.new("TextButton")
  66. local Ribbon = Instance.new("Frame")
  67. local TextLabel = Instance.new("TextLabel")
  68. local close = Instance.new("TextButton")
  69. local Load = Instance.new("TextButton")
  70. local SaveWorkspace = Instance.new("TextButton")
  71. --Properties:
  72. Script2File.Name = "Script2File"
  73. Script2File.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  74. Script2File.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  75.  
  76. Main.Name = "Main"
  77. Main.Parent = Script2File
  78. Main.Active = true
  79. Main.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  80. Main.Position = UDim2.new(0.0147601496, 0, 0.0226843096, 0)
  81. Main.Size = UDim2.new(0, 748, 0, 410)
  82.  
  83. ScriptsFrame.Name = "ScriptsFrame"
  84. ScriptsFrame.Parent = Main
  85. ScriptsFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  86. ScriptsFrame.BackgroundTransparency = 1
  87. ScriptsFrame.Position = UDim2.new(0, 0, 0.0658536553, 0)
  88. ScriptsFrame.Size = UDim2.new(0, 266, 0, 383)
  89.  
  90. Scroll.Name = "Scroll"
  91. Scroll.Parent = ScriptsFrame
  92. Scroll.BackgroundColor3 = Color3.new(1, 1, 1)
  93. Scroll.BackgroundTransparency = 1
  94. Scroll.Size = UDim2.new(1, 0, 1, 0)
  95. Scroll.BottomImage = "rbxassetid://148970562"
  96. Scroll.MidImage = "rbxassetid://148970562"
  97. Scroll.TopImage = "rbxassetid://148970562"
  98.  
  99. Example.Name = "Example"
  100. Example.Parent = Scroll
  101. Example.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
  102. Example.Position = UDim2.new(0.0451127812, 0, 0.02610966, 0)
  103. Example.Size = UDim2.new(0, 222, 0, 26)
  104. Example.Visible = false
  105. Example.Font = Enum.Font.SourceSans
  106. Example.Text = "example"
  107. Example.TextColor3 = Color3.new(1, 1, 1)
  108. Example.TextSize = 16
  109.  
  110. UIListLayout.Parent = ScriptsFrame
  111.  
  112. Decompile.Name = "Decompile"
  113. Decompile.Parent = Main
  114. Decompile.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  115. Decompile.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
  116. Decompile.Position = UDim2.new(0.589572191, 0, 0.0829268321, 0)
  117. Decompile.Size = UDim2.new(0, 114, 0, 28)
  118. Decompile.Font = Enum.Font.SourceSansBold
  119. Decompile.Text = "DECOMPILE SCRIPT"
  120. Decompile.TextColor3 = Color3.new(0.14902, 1, 0.247059)
  121. Decompile.TextSize = 14
  122. Decompile.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
  123.  
  124. Edit.Name = "Edit"
  125. Edit.Parent = Main
  126. Edit.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  127. Edit.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
  128. Edit.Position = UDim2.new(0.752673805, 0, 0.0829268321, 0)
  129. Edit.Size = UDim2.new(0, 78, 0, 28)
  130. Edit.Font = Enum.Font.SourceSansBold
  131. Edit.Text = "EDIT SCRIPT"
  132. Edit.TextColor3 = Color3.new(0.14902, 1, 0.247059)
  133. Edit.TextSize = 14
  134. Edit.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
  135.  
  136. EditSource.Name = "EditSource"
  137. EditSource.Parent = Main
  138. EditSource.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  139. EditSource.ClipsDescendants = true
  140. EditSource.Position = UDim2.new(0.366310149, 0, 0.185365856, 0)
  141. EditSource.Size = UDim2.new(0, 466, 0, 291)
  142.  
  143. Edit_2.Name = "Edit"
  144. Edit_2.Parent = EditSource
  145. Edit_2.BackgroundColor3 = Color3.new(1, 1, 1)
  146. Edit_2.BackgroundTransparency = 1
  147. Edit_2.Size = UDim2.new(0, 466, 0, 316)
  148. Edit_2.BottomImage = "rbxassetid://148970562"
  149. Edit_2.MidImage = "rbxassetid://148970562"
  150. Edit_2.TopImage = "rbxassetid://148970562"
  151.  
  152. Ed.Name = "Ed"
  153. Ed.Parent = Edit_2
  154. Ed.BackgroundColor3 = Color3.new(1, 1, 1)
  155. Ed.BackgroundTransparency = 1
  156. Ed.Position = UDim2.new(0.0493562222, 0, 4.82873084e-08, 0)
  157. Ed.Size = UDim2.new(0.950643778, 0, 1.8417722, 0)
  158. Ed.ClearTextOnFocus = false
  159. Ed.Font = Enum.Font.SourceSans
  160. Ed.MultiLine = true
  161. Ed.Text = ""
  162. Ed.TextColor3 = Color3.new(0.654902, 0.654902, 0.654902)
  163. Ed.TextSize = 14
  164. Ed.TextXAlignment = Enum.TextXAlignment.Left
  165. Ed.TextYAlignment = Enum.TextYAlignment.Top
  166.  
  167. Keywords.Name = "Keywords"
  168. Keywords.Parent = Ed
  169. Keywords.BackgroundColor3 = Color3.new(1, 1, 1)
  170. Keywords.BackgroundTransparency = 1
  171. Keywords.Size = UDim2.new(1, 0, 1, 0)
  172. Keywords.Font = Enum.Font.SourceSans
  173. Keywords.Text = " "
  174. Keywords.TextColor3 = Color3.new(1, 0, 0.0156863)
  175. Keywords.TextSize = 14
  176. Keywords.TextXAlignment = Enum.TextXAlignment.Left
  177.  
  178. Globals.Name = "Globals"
  179. Globals.Parent = Ed
  180. Globals.BackgroundColor3 = Color3.new(1, 1, 1)
  181. Globals.BackgroundTransparency = 1
  182. Globals.Size = UDim2.new(1, 0, 1, 0)
  183. Globals.Font = Enum.Font.SourceSans
  184. Globals.Text = " "
  185. Globals.TextColor3 = Color3.new(0, 1, 0)
  186. Globals.TextSize = 14
  187. Globals.TextXAlignment = Enum.TextXAlignment.Left
  188.  
  189. Strings.Name = "Strings"
  190. Strings.Parent = Ed
  191. Strings.BackgroundColor3 = Color3.new(1, 1, 1)
  192. Strings.BackgroundTransparency = 1
  193. Strings.Size = UDim2.new(1, 0, 1, 0)
  194. Strings.Font = Enum.Font.SourceSans
  195. Strings.Text = " "
  196. Strings.TextColor3 = Color3.new(0, 1, 0)
  197. Strings.TextSize = 14
  198. Strings.TextXAlignment = Enum.TextXAlignment.Left
  199.  
  200. ExploitKeywords.Name = "ExploitKeywords"
  201. ExploitKeywords.Parent = Ed
  202. ExploitKeywords.BackgroundColor3 = Color3.new(1, 1, 1)
  203. ExploitKeywords.BackgroundTransparency = 1
  204. ExploitKeywords.Size = UDim2.new(1, 0, 1, 0)
  205. ExploitKeywords.Font = Enum.Font.SourceSans
  206. ExploitKeywords.Text = " "
  207. ExploitKeywords.TextColor3 = Color3.new(0, 1, 0)
  208. ExploitKeywords.TextSize = 14
  209. ExploitKeywords.TextXAlignment = Enum.TextXAlignment.Left
  210.  
  211. _Line.Name = "_Line"
  212. _Line.Parent = Edit_2
  213. _Line.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  214. _Line.Size = UDim2.new(0, 22, 1, 0)
  215. _Line.Font = Enum.Font.Code
  216. _Line.Text = "1"
  217. _Line.TextColor3 = Color3.new(1, 1, 1)
  218. _Line.TextSize = 16
  219. _Line.TextYAlignment = Enum.TextYAlignment.Top
  220.  
  221. DecompileResult.Name = "DecompileResult"
  222. DecompileResult.Parent = Main
  223. DecompileResult.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  224. DecompileResult.ClipsDescendants = true
  225. DecompileResult.Position = UDim2.new(0.366310149, 0, 0.185365856, 0)
  226. DecompileResult.Size = UDim2.new(0, 466, 0, 291)
  227. DecompileResult.Visible = false
  228.  
  229. DecompileSource.Name = "DecompileSource"
  230. DecompileSource.Parent = DecompileResult
  231. DecompileSource.BackgroundColor3 = Color3.new(1, 1, 1)
  232. DecompileSource.BackgroundTransparency = 1
  233. DecompileSource.Size = UDim2.new(0, 466, 0, 316)
  234. DecompileSource.BottomImage = "rbxassetid://148970562"
  235. DecompileSource.MidImage = "rbxassetid://148970562"
  236. DecompileSource.TopImage = "rbxassetid://148970562"
  237.  
  238. Decompiled.Name = "Decompiled"
  239. Decompiled.Parent = DecompileSource
  240. Decompiled.BackgroundColor3 = Color3.new(1, 1, 1)
  241. Decompiled.BackgroundTransparency = 1
  242. Decompiled.Position = UDim2.new(0.0489999987, 0, 0, 0)
  243. Decompiled.Size = UDim2.new(0.950999975, 0, 1.84200001, 0)
  244. Decompiled.Font = Enum.Font.SourceSans
  245. Decompiled.Text = " "
  246. Decompiled.TextColor3 = Color3.new(0.737255, 0.737255, 0.737255)
  247. Decompiled.TextSize = 14
  248. Decompiled.TextXAlignment = Enum.TextXAlignment.Left
  249.  
  250. Keywords_2.Name = "Keywords"
  251. Keywords_2.Parent = Decompiled
  252. Keywords_2.BackgroundColor3 = Color3.new(1, 1, 1)
  253. Keywords_2.BackgroundTransparency = 1
  254. Keywords_2.Size = UDim2.new(1, 0, 1, 0)
  255. Keywords_2.Font = Enum.Font.SourceSans
  256. Keywords_2.Text = " "
  257. Keywords_2.TextColor3 = Color3.new(1, 0, 0.0156863)
  258. Keywords_2.TextSize = 14
  259. Keywords_2.TextXAlignment = Enum.TextXAlignment.Left
  260.  
  261. Globals_2.Name = "Globals"
  262. Globals_2.Parent = Decompiled
  263. Globals_2.BackgroundColor3 = Color3.new(1, 1, 1)
  264. Globals_2.BackgroundTransparency = 1
  265. Globals_2.Size = UDim2.new(1, 0, 1, 0)
  266. Globals_2.Font = Enum.Font.SourceSans
  267. Globals_2.Text = " "
  268. Globals_2.TextColor3 = Color3.new(0, 1, 0)
  269. Globals_2.TextSize = 14
  270. Globals_2.TextXAlignment = Enum.TextXAlignment.Left
  271.  
  272. Line.Name = "Line"
  273. Line.Parent = DecompileSource
  274. Line.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  275. Line.Size = UDim2.new(0, 22, 1, 0)
  276. Line.Font = Enum.Font.Code
  277. Line.Text = "1"
  278. Line.TextColor3 = Color3.new(1, 1, 1)
  279. Line.TextSize = 16
  280. Line.TextYAlignment = Enum.TextYAlignment.Top
  281.  
  282. View.Name = "View"
  283. View.Parent = Main
  284. View.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  285. View.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
  286. View.Position = UDim2.new(0.871657729, 0, 0.0829268321, 0)
  287. View.Size = UDim2.new(0, 74, 0, 28)
  288. View.Font = Enum.Font.SourceSansBold
  289. View.Text = "VIEW"
  290. View.TextColor3 = Color3.new(0.14902, 1, 0.247059)
  291. View.TextSize = 14
  292. View.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
  293.  
  294. Copy.Name = "Copy"
  295. Copy.Parent = Main
  296. Copy.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  297. Copy.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  298. Copy.Position = UDim2.new(0.366310179, 0, 0.914634168, 0)
  299. Copy.Size = UDim2.new(0, 90, 0, 28)
  300. Copy.Font = Enum.Font.SourceSansBold
  301. Copy.Text = "COPY"
  302. Copy.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  303. Copy.TextSize = 14
  304. Copy.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  305.  
  306. Clear.Name = "Clear"
  307. Clear.Parent = Main
  308. Clear.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  309. Clear.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  310. Clear.Position = UDim2.new(0.85799998, 0, 0.915000021, 0)
  311. Clear.Size = UDim2.new(0, 97, 0, 28)
  312. Clear.Font = Enum.Font.SourceSansBold
  313. Clear.Text = "CLEAR"
  314. Clear.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  315. Clear.TextSize = 14
  316. Clear.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  317.  
  318. Apply.Name = "Apply"
  319. Apply.Parent = Main
  320. Apply.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  321. Apply.BorderColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  322. Apply.Position = UDim2.new(0.741978586, 0, 0.914634168, 0)
  323. Apply.Size = UDim2.new(0, 80, 0, 28)
  324. Apply.Font = Enum.Font.SourceSansBold
  325. Apply.Text = "APPLY"
  326. Apply.TextColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  327. Apply.TextSize = 14
  328. Apply.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  329.  
  330. Save.Name = "Save"
  331. Save.Parent = Main
  332. Save.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  333. Save.BorderColor3 = Color3.new(0.745098, 0, 0)
  334. Save.Position = UDim2.new(0.624331594, 0, 0.914634168, 0)
  335. Save.Size = UDim2.new(0, 79, 0, 28)
  336. Save.Font = Enum.Font.SourceSansBold
  337. Save.Text = "SAVE"
  338. Save.TextColor3 = Color3.new(0.745098, 0, 0)
  339. Save.TextSize = 14
  340. Save.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  341.  
  342. Ribbon.Name = "Ribbon"
  343. Ribbon.Parent = Main
  344. Ribbon.Active = true
  345. Ribbon.BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431)
  346. Ribbon.Size = UDim2.new(0, 748, 0, 27)
  347.  
  348. TextLabel.Parent = Ribbon
  349. TextLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  350. TextLabel.BackgroundTransparency = 1
  351. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  352. TextLabel.Font = Enum.Font.SourceSans
  353. TextLabel.Text = "S2F"
  354. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  355. TextLabel.TextSize = 22
  356.  
  357. close.Name = "close"
  358. close.Parent = Ribbon
  359. close.BackgroundColor3 = Color3.new(1, 0.215686, 0.254902)
  360. close.Position = UDim2.new(0.946524084, 0, 0, 0)
  361. close.Size = UDim2.new(0, 40, 0, 27)
  362. close.Font = Enum.Font.SourceSans
  363. close.Text = "_"
  364. close.TextColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  365. close.TextSize = 14
  366.  
  367. Load.Name = "Load"
  368. Load.Parent = Main
  369. Load.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  370. Load.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
  371. Load.Position = UDim2.new(0.502673864, 0, 0.914634168, 0)
  372. Load.Size = UDim2.new(0, 79, 0, 28)
  373. Load.Font = Enum.Font.SourceSansBold
  374. Load.Text = "LOAD"
  375. Load.TextColor3 = Color3.new(0.14902, 1, 0.247059)
  376. Load.TextSize = 14
  377. Load.TextStrokeColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  378.  
  379. SaveWorkspace.Name = "SaveWorkspace"
  380. SaveWorkspace.Parent = Main
  381. SaveWorkspace.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  382. SaveWorkspace.BorderColor3 = Color3.new(0.14902, 1, 0.247059)
  383. SaveWorkspace.Position = UDim2.new(0.445187211, 0, 0.0829268321, 0)
  384. SaveWorkspace.Size = UDim2.new(0, 98, 0, 28)
  385. SaveWorkspace.Font = Enum.Font.SourceSansBold
  386. SaveWorkspace.Text = "SAVE WORKSAPCE"
  387. SaveWorkspace.TextColor3 = Color3.new(0.14902, 1, 0.247059)
  388. SaveWorkspace.TextSize = 14
  389. SaveWorkspace.TextStrokeColor3 = Color3.new(0.14902, 1, 0.247059)
  390.  
  391. local logSound = Instance.new("Sound")
  392. local topPress = Instance.new("Sound")
  393. local errorSound = Instance.new("Sound")
  394. local openSound = Instance.new("Sound")
  395. local disableSound = Instance.new("Sound")
  396.  
  397. local sounds = {logSound, topPress, errorSound, openSound, disableSound}
  398.  
  399. logSound.SoundId = "rbxassetid://917942453"
  400.  
  401. errorSound.SoundId = "rbxassetid://582374365"
  402.  
  403. topPress.SoundId = "rbxassetid://558993260"
  404.  
  405. openSound.SoundId = "rbxassetid://472556995"
  406.  
  407. disableSound.SoundId = "rbxassetid://550209561"
  408.  
  409. local last
  410. _Line.Parent = Edit_2
  411. _Line.Position = UDim2.new(0,0,0,0)
  412.  
  413. function Encode(table)
  414. return HttpService:JSONEncode(table)
  415. end
  416. function Decode(table)
  417. return HttpService:JSONDecode(table)
  418. end
  419. local SaveFile = {
  420. lastfile = last,
  421. Theme = 'Dark'
  422. }
  423.  
  424. local defaults = Encode(SaveFile)
  425.  
  426. function getlast()
  427. local file = writefile("DataLast.json",defaults)
  428. local newjson = readfile("DataLast.json")
  429. local createfile = Decode(newjson)
  430. if createfile.last == nil then
  431. last = nil
  432. else
  433. last = createfile.lastfile
  434. end
  435. end
  436. local theme = 'Dark'
  437. function GetAllSaved()
  438. local file = writefile("F2S.json",defaults)
  439. local newjson = readfile("F2S.json")
  440. local createfile = Decode(newjson)
  441. if createfile == nil then
  442. last = nil
  443. theme = 'Dark'
  444. else
  445. last = createfile.lastfile
  446. theme = createfile.Theme
  447. end
  448. end
  449.  
  450. getlast()
  451. GetAllSaved()
  452.  
  453. local playSound = function(sound, int)
  454. spawn(function()
  455. local s = sound:Clone()
  456. s.Parent = Script2File
  457. s:Play()
  458. s.PlaybackSpeed = int
  459. end)
  460. end
  461.  
  462. function AutoIndent(string)
  463.  
  464. end
  465.  
  466. local Highlight = function(string, keywords)
  467. local K = {}
  468. local S = string
  469. local Token =
  470. {
  471. ["="] = true,
  472. ["."] = true,
  473. [","] = true,
  474. ["("] = true,
  475. [")"] = true,
  476. ["["] = true,
  477. ["]"] = true,
  478. ["{"] = true,
  479. ["}"] = true,
  480. [":"] = true,
  481. ["*"] = true,
  482. ["/"] = true,
  483. ["+"] = true,
  484. ["-"] = true,
  485. ["%"] = true,
  486. [";"] = true,
  487. ["~"] = true
  488. }
  489. for i, v in pairs(keywords) do
  490. K[v] = true
  491. end
  492. S = S:gsub(".", function(c)
  493. if Token[c] ~= nil then
  494. return "\32"
  495. else
  496. return c
  497. end
  498. end)
  499. S = S:gsub("%S+", function(c)
  500. if K[c] ~= nil then
  501. return c
  502. else
  503. return (" "):rep(#c)
  504. end
  505. end)
  506.  
  507. return S
  508. end
  509.  
  510. local hTokens = function(string)
  511. local Token =
  512. {
  513. ["="] = true,
  514. ["."] = true,
  515. [","] = true,
  516. ["("] = true,
  517. [")"] = true,
  518. ["["] = true,
  519. ["]"] = true,
  520. ["{"] = true,
  521. ["}"] = true,
  522. [":"] = true,
  523. ["*"] = true,
  524. ["/"] = true,
  525. ["+"] = true,
  526. ["-"] = true,
  527. ["%"] = true,
  528. [";"] = true,
  529. ["~"] = true
  530. }
  531. local A = ""
  532. string:gsub(".", function(c)
  533. if Token[c] ~= nil then
  534. A = A .. c
  535. elseif c == "\n" then
  536. A = A .. "\n"
  537. elseif c == "\t" then
  538. A = A .. "\t"
  539. else
  540. A = A .. "\32"
  541. end
  542. end)
  543.  
  544. return A
  545. end
  546.  
  547.  
  548. local strings = function(string)
  549. local highlight = ""
  550. local quote = false
  551. string:gsub(".", function(c)
  552. if quote == false and c == "\"" then
  553. quote = true
  554. elseif quote == true and c == "\"" then
  555. quote = false
  556. end
  557. if quote == false and c == "\"" then
  558. highlight = highlight .. "\""
  559. elseif c == "\n" then
  560. highlight = highlight .. "\n"
  561. elseif c == "\t" then
  562. highlight = highlight .. "\t"
  563. elseif quote == true then
  564. highlight = highlight .. c
  565. elseif quote == false then
  566. highlight = highlight .. "\32"
  567. end
  568. end)
  569.  
  570. return highlight
  571. end
  572.  
  573. local comments = function(string)
  574. local ret = ""
  575. string:gsub("[^\r\n]+", function(c)
  576. local comm = false
  577. local i = 0
  578. c:gsub(".", function(n)
  579. i = i + 1
  580. if c:sub(i, i + 1) == "--" then
  581. comm = true
  582. end
  583. if comm == true then
  584. ret = ret .. n
  585. else
  586. ret = ret .. "\32"
  587. end
  588. end)
  589. ret = ret
  590. end)
  591.  
  592. return ret
  593. end
  594. Main.Draggable = true
  595. Globals.TextSize = 15
  596. Globals.Font = 'Code'
  597. Keywords.TextSize = 15
  598. Keywords.Font = 'Code'
  599. Globals_2.TextSize = 15
  600. Globals_2.Font = 'Code'
  601. Keywords_2.TextSize = 15
  602. Keywords_2.Font = 'Code'
  603. Ed.TextSize = 15
  604. Ed.Font = 'Code'
  605. Decompiled.TextSize = 15
  606. Decompiled.Font = 'Code'
  607. Strings.TextSize = 15
  608. Strings.Font = 'Code'
  609. ExploitKeywords.TextSize = 15
  610. ExploitKeywords.Font = 'Code'
  611. local Selected = nil
  612. Script2File.ResetOnSpawn = false
  613. 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"}
  614. 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"}
  615. local global_genv = {"readfile","dofile","unlock_modulescript","HttpGet","load","loadfile","writefile","InvokeServer","FireServer","getgenv","getsenv","getmenv","GetObjects","get_nil_instances","decompile","dump_function","get_script_function","get_script_byteCode","PROTOSMASHER_LOADED","is_protosmasher_caller","Synapse","make_readonly","make_writeable","is_readonly","is_writeable","pebc","pebc_load","pebc_save","pebc_create","char","sub","len","fucking dont even type this in"}
  616. local commentt = Strings:Clone()
  617. commentt.Parent = Ed
  618. commentt.TextColor3 = Color3.new(.1,.85,0)
  619. function Highlight_Source()
  620. Globals.Text = Highlight(Ed.Text,global_env)
  621. Keywords.Text = Highlight(Ed.Text,lua_keywords)
  622. Globals_2.Text = Highlight(Decompiled.Text,global_env)
  623. Keywords_2.Text = Highlight(Decompiled.Text,lua_keywords)
  624. ExploitKeywords.Text = Highlight(Ed.Text,global_genv)
  625. strings(Decompiled.Text)
  626. Strings.Text = strings(Ed.Text)
  627. commentt.Text = comments(Ed.Text)
  628. comments(Decompiled.Text)
  629. DecompileSource.CanvasSize = UDim2.new(0,0,0,20000)
  630. local lin = 1
  631. local lin2 = 1
  632. local s = Ed.Text
  633. local g = Decompiled.Text
  634. s:gsub("\n",function()
  635. lin = lin + 1
  636. end)
  637. Line.Text = ''
  638. _Line.Text = ''
  639. g:gsub('\n',function()
  640. lin2 = lin2 + 1
  641. end)
  642. for i = 1, lin do
  643. _Line.Text = _Line.Text.. i.. '\n'
  644. end
  645. for i = 1, lin2 do
  646. Line.Text = Line.Text.. i.. '\n'
  647. end
  648. end
  649. Strings.TextColor3 = Color3.new(.85,.65,.21)
  650. ExploitKeywords.TextColor3 = Color3.new(.04,.775,.936)
  651.  
  652. function Switch_()
  653. DecompileResult.Visible=false
  654. EditSource.Visible=true
  655. Copy.Visible = false
  656. Apply.Visible = true
  657. Save.Visible = true
  658. Copy.Visible = false
  659. Clear.Visible = true
  660. Load.Visible = true
  661. playSound(topPress,1)
  662. end
  663. function sw2()
  664. playSound(topPress,1)
  665. DecompileResult.Visible=true
  666. EditSource.Visible=false
  667. Copy.Visible = true
  668. Apply.Visible = false
  669. Save.Visible = true
  670. Clear.Visible = false
  671. Load.Visible = false
  672. end
  673. closed = false
  674. local count = 0
  675. function SaveToLocalFile()
  676. if DecompileResult.Visible==true then
  677. local j = "--Decompiled by S2F\n"
  678. local jj = "--Created by tollepuxis\n"
  679. local jjj = "--Script path: ".. GetPath(Selected).."\n"
  680. local k = j..jj..jjj
  681. local ffs = decompile(Selected)
  682. local hfd = k.. ffs
  683. writefile("//DecompiledScripts/".. Selected.Name.. ".lua",hfd)
  684. else
  685. count = count + 1
  686. local Path = "//SavedScripts/"
  687. local type = 'lua'
  688. local Name = "Script".. count.. ".".. type
  689. writefile(Path..Name,Ed.Text)
  690. do
  691. last = Path.. Name
  692. getlast()
  693. end
  694. end
  695. end
  696. function Close()
  697. if closed==false then
  698. closed = true
  699. playSound(openSound,.9)
  700. Main.ClipsDescendants = true
  701. DecompileResult.Visible = false
  702. EditSource.Visible = false
  703. ScriptsFrame.Visible = false
  704. Decompile.Visible = false
  705. Edit.Visible = false
  706. View.Visible = false
  707. Apply.Visible = false
  708. Copy.Visible = false
  709. Save.Visible = false
  710. Main:TweenSize(UDim2.new(0,108,0,27),'InOut','Quint',.4)
  711. close:TweenPosition(UDim2.new(0.091,0,0,0),'InOut','Quint',.4)
  712. TextLabel:TweenSize(UDim2.new(0,50,0,27),'InOut','Quint',.4)
  713. else
  714. playSound(openSound,1)
  715. closed = false
  716. Main:TweenSize(UDim2.new(0,748,0,410),'InOut','Quint',.4)
  717. close:TweenPosition(UDim2.new(0.946524084, 0, 0, 0),'InOut','Quint',.4)
  718. TextLabel:TweenSize(UDim2.new(1,0,0,27),'InOut','Quint',.4)
  719. Main:TweenPosition(UDim2.new(0,Main.AbsolutePosition.X/10,0,Main.AbsolutePosition.Y/10),'InOut','Quint',.4)
  720. wait(.41)
  721. DecompileResult.Visible = true
  722. EditSource.Visible = false
  723. ScriptsFrame.Visible = true
  724. Decompile.Visible = true
  725. Edit.Visible = true
  726. Main.ClipsDescendants = false
  727. View.Visible = true
  728. Apply.Visible = true
  729. end
  730. end
  731. Apply.MouseButton1Click:Connect(function()
  732. playSound(topPress,1)
  733. local func = loadstring(Ed.Text)
  734. if func then
  735. func()
  736. else
  737. func()
  738. end
  739. end)
  740. Decompile.MouseButton1Click:Connect(function()
  741. Decompiled.Text = "Decompiling, please wait..."
  742. local rfdd = decompile(Selected)
  743. local j = "--Decompiled by S2F\n"
  744. local jj = "--Created by tollepuxis\n"
  745. local jjj = "--Script path: ".. GetPath(Selected).."\n"
  746. local k = j..jj..jjj
  747. Decompiled.Text = ''
  748. Ed.Text = ''
  749. Decompiled.Text = k.. rfdd
  750. Highlight_Source()
  751. playSound(topPress,1)
  752. end)
  753.  
  754. Globals.TextYAlignment = 'Top'
  755. Globals_2.TextYAlignment = 'Top'
  756. Keywords.TextYAlignment = 'Top'
  757. Keywords_2.TextYAlignment = 'Top'
  758. ExploitKeywords.TextYAlignment = 'Top'
  759. Strings.TextYAlignment = 'Top'
  760. Ed.Changed:Connect(Highlight_Source)
  761. Edit.MouseButton1Click:Connect(Switch_)
  762. View.MouseButton1Click:Connect(sw2)
  763. close.MouseButton1Click:Connect(Close)
  764.  
  765. --getting all the locals and modules
  766.  
  767. local modules, locals = {},{}
  768.  
  769. function Scan(obj)
  770. for i,v in pairs(obj) do
  771. if v:IsA("ModuleScript") and v.Name:sub(1,4):lower()~="chat" and v.Name~="BubbleChat" then
  772. table.insert(modules,v)
  773. elseif v:isA("LocalScript") and v.Name~="Animate" and v.Name:sub(1,4):lower()~="chat" and v.Name~="BubbleChat" and v.Name~="LocalSound" and v.Name~="Drag" then
  774. table.insert(locals,v)
  775. end
  776. Scan(v:GetChildren())
  777. end
  778. end
  779.  
  780. Scan(workspace:GetChildren())
  781. Scan(game:GetService("ReplicatedStorage"):GetChildren())
  782. Scan(Player:GetChildren())
  783.  
  784. for f,x in pairs(modules) do
  785. local new = Example:Clone()
  786. new.Visible = true
  787. new.Parent = Scroll
  788. new.Text = x.Name
  789. new.Position = UDim2.new(0,0,0,f * 30)
  790. new.MouseButton1Click:Connect(function()
  791. Selected = x
  792. end)
  793. end
  794.  
  795.  
  796. for f,x in pairs(locals) do
  797. local new = Example:Clone()
  798. new.Visible = true
  799. new.Parent = Scroll
  800. new.Text = x.Name
  801. new.Position = UDim2.new(0,0,0,f * 30)
  802. new.MouseButton1Click:Connect(function()
  803. Selected = x
  804. end)
  805. end
  806.  
  807.  
  808. Ed.TextYAlignment = 'Top'
  809. Decompiled.TextYAlignment = 'Top'
  810. sw2()
  811. Clear.MouseButton1Click:Connect(function()
  812. Ed.Text = '' playSound(topPress,1)
  813. end)
  814. Copy.MouseButton1Click:Connect(function()
  815. Ed.Text = ''
  816. playSound(topPress,1)
  817. setclipboard(Decompiled.Text)
  818. end)
  819. Save.MouseButton1Click:Connect(SaveToLocalFile)
  820.  
  821. DecompileSource.CanvasSize = UDim2.new(0,0,0,20000)
  822. Edit_2.CanvasSize = UDim2.new(0,0,0,20000)
  823. Scroll.CanvasSize = UDim2.new(0,0,0,20000)
  824. local gameF = 'print("S2F Script Editor")'
  825.  
  826. Apply.Text = 'EXECUTE'
  827. Edit.Text = "EXECUTION"
  828. Ed.Text = gameF
  829. Highlight_Source()
  830. Line.Text = '1'
  831. _Line.Text = '1'
  832.  
  833.  
  834. function LoadLastFile()
  835. if last ~= nil then
  836. local retxt = readfile(last)
  837. Ed.Text = retxt
  838. end
  839. end
  840.  
  841. Load.MouseButton1Click:Connect(LoadLastFile)
  842. Main.BorderSizePixel = 0
  843. close.BorderSizePixel = 0
  844. Scroll.BorderSizePixel = 0
  845. Edit_2.BorderSizePixel = 0
  846. Line.BorderSizePixel = 0
  847. _Line.BorderSizePixel = 0
  848. Example.BorderSizePixel = 0
  849. DecompileResult.BorderSizePixel = 0
  850. Decompiled.BorderSizePixel = 0
  851. EditSource.BorderSizePixel = 0
  852. Globals_2.TextColor3 = Color3.new(1,0,0)
  853. Keywords_2.TextColor3 = Color3.new(0,1,0)
  854. Globals.TextColor3 = Color3.new(1,0,0)
  855. Keywords.TextColor3 = Color3.new(0,1,0)
  856. function save_workspace()
  857. local folder = Instance.new("Folder")
  858. folder.Name = "Workspace"
  859. local source = Instance.new("StringValue",folder)
  860. source.Value = [[
  861. for _,v in pairs(workspace.Workspace:GetChildren()) do
  862. v.Parent = workspace
  863. end]]
  864. source.Name = "Unpack"
  865. for _,v in pairs(workspace:GetChildren()) do
  866. if not v:isA("Terrain") then
  867. v.Parent = folder
  868. end
  869. end
  870. for _,v in pairs(folder:GetChildren()) do
  871. v:Clone().Parent = workspace
  872. end
  873. saveinstance("Workspace",folder)
  874. end
  875. SaveWorkspace.MouseButton1Down:Connect(save_workspace)
  876. while true do
  877. wait()
  878. if theme == "Dark" then
  879. Main.BackgroundColor3 = Color3.new(30/255,30/255,30/255)
  880. elseif theme == "light" then
  881. Main.BackgroundColor3 = Color3.new(.9,.9,.9)
  882. end
  883.  
  884. SaveFile = {
  885. lastfile = last,
  886. Theme = theme
  887. }
  888. wait()
  889. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement