Advertisement
ERROR_CODE

test saves

Nov 20th, 2024 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.67 KB | None | 0 0
  1. ScreenGui = Instance.new("ScreenGui")
  2. SearchBox = Instance.new("TextBox")
  3. SavedScriptsScrollingFrame = Instance.new("ScrollingFrame")
  4.  
  5. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  6.  
  7. SearchBox.Parent = ScreenGui
  8. SearchBox.Size = UDim2.new(0, 200, 0, 50)
  9. SearchBox.Position = UDim2.new(0.5, 0, 0.2, 0)
  10. SearchBox.PlaceholderText = "Введите текст..."
  11.  
  12. SavedScriptsScrollingFrame.Parent = ScreenGui
  13. SavedScriptsScrollingFrame.Size = UDim2.new(0, 395, 0, 229.9)
  14. SavedScriptsScrollingFrame.Position = UDim2.new(0.5, 0, 0.4, 0)
  15. SavedScriptsScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  16. SavedScriptsScrollingFrame.ScrollBarThickness = 0
  17.  
  18. local Saves = {}
  19.  
  20. if not isfile("Test.ECCS") then
  21. writefile("Test.ECCS", "")
  22. end
  23.  
  24. File1 = readfile("Test.ECCS")
  25.  
  26. for s in string.gmatch(File1, '([^,]+)') do
  27. table.insert(Saves, s:match("^%s*(.-)%s*$"))
  28. end
  29.  
  30. local function findResult(tbl, value)
  31. local index = table.find(tbl, value)
  32. if index then
  33. return true
  34. else
  35. return false
  36. end
  37. end
  38.  
  39. SavedScriptsScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  40.  
  41. local function updateSaves()
  42. SavedScriptsScrollingFrame:ClearAllChildren()
  43. for _, SavedS in ipairs(Saves) do
  44.  
  45. local scriptName, imageId, showLabel, VerAuthor, author, gameName, scriptContent = SavedS:match("^(.-)~(%d+)~(.-)~(.-)~(.-)~(.-)~(.+)$")
  46.  
  47. UIGridLayoutSaves = Instance.new("UIGridLayout")
  48. UIPaddingSaves = Instance.new("UIPadding")
  49. UIGridLayoutSaves.Parent = SavedScriptsScrollingFrame
  50. UIGridLayoutSaves.SortOrder = Enum.SortOrder.LayoutOrder
  51. UIGridLayoutSaves.CellPadding = UDim2.new(0, 0, 0, 5)
  52. UIGridLayoutSaves.CellSize = UDim2.new(0, 395, 0, 220)
  53. UIGridLayoutSaves.HorizontalAlignment = Enum.HorizontalAlignment.Left
  54. UIGridLayoutSaves.SortOrder = Enum.SortOrder.LayoutOrder
  55. UIGridLayoutSaves.VerticalAlignment = Enum.VerticalAlignment.Top
  56.  
  57. UIPaddingSaves.Parent = SavedScriptsScrollingFrame
  58. UIPaddingSaves.PaddingBottom = UDim.new(0, 5)
  59. UIPaddingSaves.PaddingLeft = UDim.new(0, 0)
  60. UIPaddingSaves.PaddingRight = UDim.new(0, 0)
  61. UIPaddingSaves.PaddingTop = UDim.new(0, 5)
  62.  
  63. local SavedScriptsFrame = Instance.new("Frame")
  64. SavedScriptsFrame.Parent = SavedScriptsScrollingFrame
  65.  
  66. local SavedScriptImage = Instance.new("ImageLabel")
  67. SavedScriptImage.Parent = SavedScriptsFrame
  68. SavedScriptImage.Size = UDim2.new(0, 395, 0, 220)
  69. SavedScriptImage.AnchorPoint = Vector2.new(0.5, 0.5)
  70. SavedScriptImage.Position = UDim2.new(0.5, 0, 0.5, 0)
  71. SavedScriptImage.BackgroundTransparency = 1
  72.  
  73. local SavedScriptImageUICorner = Instance.new("UICorner")
  74. SavedScriptImageUICorner.CornerRadius = UDim.new(0, 10)
  75. SavedScriptImageUICorner.Parent = SavedScriptImage
  76.  
  77. if game.PlaceId then
  78. SavedScriptImage.Image = "https://assetgame.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid="..imageId.."&fmt=png&wd=420&ht=420"
  79. else
  80. SavedScriptImage.Image = "rbxassetid://"..imageId
  81. end
  82.  
  83. local SavedScriptImageShadow = Instance.new("Frame")
  84. SavedScriptImageShadow.Name = "SImgShadow"
  85. SavedScriptImageShadow.Parent = SavedScriptImage
  86. SavedScriptImageShadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  87. SavedScriptImageShadow.BackgroundTransparency = 0.5
  88. SavedScriptImageShadow.AnchorPoint = Vector2.new(0.5, 0.5)
  89. SavedScriptImageShadow.Position = UDim2.new(0.5, 0, 0.5, 0)
  90. SavedScriptImageShadow.Size = UDim2.new(0, 395, 0, 220)
  91.  
  92. local SavedScriptImageShadowUICorner = Instance.new("UICorner")
  93. SavedScriptImageShadowUICorner.CornerRadius = UDim.new(0, 10)
  94. SavedScriptImageShadowUICorner.Parent = SavedScriptImageShadow
  95.  
  96. local ScriptSavesTitle = Instance.new("TextLabel")
  97. ScriptSavesTitle.Name = "ScriptSavesTitle"
  98. ScriptSavesTitle.Parent = SavedScriptsFrame
  99. ScriptSavesTitle.BackgroundTransparency = 1
  100. ScriptSavesTitle.Position = UDim2.new(0, 10, 0, 5)
  101. ScriptSavesTitle.Size = UDim2.new(0, 375, 0, 55)
  102. ScriptSavesTitle.Font = Enum.Font.ArimoBold
  103. ScriptSavesTitle.Text = scriptName
  104. ScriptSavesTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  105. ScriptSavesTitle.TextScaled = true
  106. ScriptSavesTitle.TextSize = 14.000
  107. ScriptSavesTitle.TextWrapped = true
  108. ScriptSavesTitle.TextXAlignment = Enum.TextXAlignment.Left
  109.  
  110. if VerAuthor == "true" then
  111. local AuthorLabel = Instance.new("TextLabel")
  112. AuthorLabel.Parent = SavedScriptsFrame
  113. AuthorLabel.Size = UDim2.new(0, 375, 0, 40)
  114. AuthorLabel.Position = UDim2.new(0, 10, 0, 110)
  115. AuthorLabel.Text = author
  116. AuthorLabel.TextXAlignment = Enum.TextXAlignment.Left
  117. AuthorLabel.Font = Enum.Font.ArimoBold
  118. AuthorLabel.TextSize = 20
  119. AuthorLabel.TextWrapped = true
  120. AuthorLabel.TextColor3 = Color3.fromRGB(0, 125, 255)
  121. AuthorLabel.BackgroundTransparency = 1
  122. else
  123. local AuthorLabel = Instance.new("TextLabel")
  124. AuthorLabel.Parent = SavedScriptsFrame
  125. AuthorLabel.Size = UDim2.new(0, 375, 0, 40)
  126. AuthorLabel.Position = UDim2.new(0, 10, 0, 110)
  127. AuthorLabel.Text = author
  128. AuthorLabel.TextXAlignment = Enum.TextXAlignment.Left
  129. AuthorLabel.Font = Enum.Font.ArimoBold
  130. AuthorLabel.TextSize = 20
  131. AuthorLabel.TextWrapped = true
  132. AuthorLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  133. AuthorLabel.BackgroundTransparency = 1
  134. end
  135.  
  136. local GameNameLabel = Instance.new("TextLabel")
  137. GameNameLabel.Parent = SavedScriptsFrame
  138. GameNameLabel.Size = UDim2.new(0, 375, 0, 30)
  139. GameNameLabel.Position = UDim2.new(0, 10, 0, 70)
  140. GameNameLabel.Text = gameName
  141. GameNameLabel.TextXAlignment = Enum.TextXAlignment.Left
  142. GameNameLabel.Font = Enum.Font.ArimoBold
  143. GameNameLabel.TextSize = 30
  144. GameNameLabel.TextWrapped = true
  145. GameNameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  146. GameNameLabel.BackgroundTransparency = 1
  147.  
  148. if showLabel == "true" then
  149. local KeySystemSaved = Instance.new("TextLabel")
  150. KeySystemSaved.Name = "KeySystemSaved"
  151. KeySystemSaved.Parent = SavedScriptsFrame
  152. KeySystemSaved.BackgroundColor3 = Color3.fromRGB(255, 200, 31)
  153. KeySystemSaved.Position = UDim2.new(0.025, 0, 0.85, 0)
  154. KeySystemSaved.Size = UDim2.new(0, 85, 0, 25)
  155. KeySystemSaved.Font = Enum.Font.ArimoBold
  156. KeySystemSaved.Text = " Key"
  157. KeySystemSaved.TextColor3 = Color3.fromRGB(255, 255, 255)
  158. KeySystemSaved.TextSize = 17
  159. KeySystemSaved.TextXAlignment = Enum.TextXAlignment.Left
  160. KeySystemSaved.TextYAlignment = Enum.TextYAlignment.Center
  161.  
  162. local KeySystemSavedUICorner = Instance.new("UICorner")
  163. KeySystemSavedUICorner.CornerRadius = UDim.new(0, 10)
  164. KeySystemSavedUICorner.Parent = KeySystemSaved
  165.  
  166. local KeySystemSavedImg = Instance.new("ImageLabel")
  167. KeySystemSavedImg.Name = "KeySystemSavedImg"
  168. KeySystemSavedImg.Parent = KeySystemSaved
  169. KeySystemSavedImg.BackgroundTransparency = 1
  170. KeySystemSavedImg.AnchorPoint = Vector2.new(0.5, 0.5)
  171. KeySystemSavedImg.Position = UDim2.new(0.85, 0, 0.5, 0)
  172. KeySystemSavedImg.Size = UDim2.new(0, 18, 0, 18)
  173. KeySystemSavedImg.Image = "rbxassetid://121862914614673"
  174. end
  175.  
  176. local ExecuteSavedScriptButton = Instance.new("TextButton")
  177. ExecuteSavedScriptButton.Name = "ExecuteSavedScriptButton"
  178. ExecuteSavedScriptButton.Parent = SavedScriptsFrame
  179. ExecuteSavedScriptButton.BackgroundColor3 = Color3.fromRGB(66, 170, 255)
  180. ExecuteSavedScriptButton.Position = UDim2.new(0.75, 0, 0.7, 0)
  181. ExecuteSavedScriptButton.Size = UDim2.new(0, 85, 0, 25)
  182. ExecuteSavedScriptButton.AutoButtonColor = false
  183. ExecuteSavedScriptButton.Font = Enum.Font.ArimoBold
  184. ExecuteSavedScriptButton.Text = " Execute"
  185. ExecuteSavedScriptButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  186. ExecuteSavedScriptButton.TextSize = 17
  187. ExecuteSavedScriptButton.TextXAlignment = Enum.TextXAlignment.Left
  188. ExecuteSavedScriptButton.TextYAlignment = Enum.TextYAlignment.Center
  189.  
  190. local ExecuteSavedScriptButtonUICorner = Instance.new("UICorner")
  191. ExecuteSavedScriptButtonUICorner.CornerRadius = UDim.new(0, 10)
  192. ExecuteSavedScriptButtonUICorner.Parent = ExecuteSavedScriptButton
  193.  
  194. local ExecuteSavedScriptButtonImg = Instance.new("ImageLabel")
  195. ExecuteSavedScriptButtonImg.Name = "ExecuteSavedScriptButton"
  196. ExecuteSavedScriptButtonImg.Parent = ExecuteSavedScriptButton
  197. ExecuteSavedScriptButtonImg.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  198. ExecuteSavedScriptButtonImg.BackgroundTransparency = 1
  199. ExecuteSavedScriptButtonImg.AnchorPoint = Vector2.new(0.5, 0.5)
  200. ExecuteSavedScriptButtonImg.Position = UDim2.new(0.85, 0, 0.5, 0)
  201. ExecuteSavedScriptButtonImg.Size = UDim2.new(0, 18, 0, 18)
  202. ExecuteSavedScriptButtonImg.Image = "rbxassetid://94761665022976"
  203.  
  204. ExecuteSavedScriptButton.MouseButton1Click:Connect(function()
  205. loadstring(scriptContent)()
  206. end)
  207.  
  208. end
  209. end
  210.  
  211. updateSaves()
  212.  
  213. SearchBox.FocusLost:Connect(function(enterPressed)
  214. if enterPressed then
  215. if SearchBox.Text ~= " " then
  216. local newSText = SearchBox.Text
  217. local exists_2 = false
  218. for _, SavedS in ipairs(Saves) do
  219. if SavedS:lower() == newSText:lower() then
  220. exists_2 = true
  221. break
  222. end
  223. end
  224. if not exists_2 then
  225. table.insert(Saves, newSText)
  226. writefile("Test.ECCS", table.concat(Saves, ", "))
  227. end
  228. end
  229. updateSaves()
  230. end
  231. end)
  232.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement