Parellel_X

backup

Nov 12th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.10 KB | None | 0 0
  1. local UserInput = game:GetService("UserInputService")
  2.  
  3. local Window = {}
  4. Window.__index = Window
  5.  
  6. local Tab = {}
  7. Tab.__index = Tab
  8.  
  9. local Label = {}
  10. Label.__index = Label
  11.  
  12. local Toggle = {}
  13. Toggle.__index = Toggle
  14.  
  15. local ToggleOff = 6031068433
  16. local ToggleOn = 6031068426
  17.  
  18. local Slider = {}
  19. Slider.__index = Slider
  20.  
  21. local TextBox = {}
  22. TextBox.__index = TextBox
  23.  
  24. local BuiltInThemes = {
  25. Moonlight = {
  26. MainFrame = Color3.fromRGB(45, 45, 63),
  27. TopBar = Color3.fromRGB(30, 30, 42),
  28. TabBar = Color3.fromRGB(30, 30, 42),
  29. Label = Color3.fromRGB(67, 67, 95),
  30. LabelHighlighted = Color3.fromRGB(49, 49, 70),
  31. Button = Color3.fromRGB(67, 67, 95),
  32. Toggle = Color3.fromRGB(67, 67, 95),
  33. TextBox = Color3.fromRGB(67, 67, 95),
  34. Slider = Color3.fromRGB(67, 67, 95)
  35. }
  36. }
  37.  
  38. table.freeze(BuiltInThemes)
  39. for _, colors in pairs(BuiltInThemes) do table.freeze(colors) end
  40.  
  41. local function util_lerp(a, b, f)
  42. return a + f * (b - a)
  43. end
  44.  
  45. local GUI_NAME = "Andronema"
  46.  
  47. function Window:Create(title, theme, coreGui)
  48. if coreGui == nil then coreGui = true end
  49.  
  50. local parent = coreGui and game.CoreGui or game.Players.LocalPlayer:WaitForChild("PlayerGui")
  51. local colors
  52.  
  53. if parent:FindFirstChild(GUI_NAME) then
  54. parent[GUI_NAME]:Destroy()
  55. end
  56.  
  57. if typeof(theme) == "table" then
  58. colors = theme
  59. elseif typeof(theme) == "string" then
  60. colors = BuiltInThemes[theme]
  61. else
  62. colors = BuiltInThemes.Moonlight
  63. end
  64.  
  65. local screenGui = Instance.new("ScreenGui")
  66. local mainFrame = Instance.new("Frame")
  67. local mainFrameUICorner = Instance.new("UICorner")
  68. local mainFrameShadow = Instance.new("ImageLabel")
  69.  
  70. local topBarFrame = Instance.new("Frame")
  71. local topBarUICorner = Instance.new("UICorner")
  72. local titleTextLabel = Instance.new("TextLabel")
  73. local closeImageButton = Instance.new("ImageButton")
  74.  
  75. local tabBarFrame = Instance.new("ScrollingFrame")
  76. local tabBarFrameUICorner = Instance.new("UICorner")
  77. local tabBarFrameUIGridLayout = Instance.new("UIGridLayout")
  78.  
  79. local tabs = Instance.new("Folder")
  80.  
  81. mainFrame.Name = "Main"
  82. mainFrame.Parent = screenGui
  83. mainFrame.BackgroundColor3 = colors.MainFrame
  84. mainFrame.BorderSizePixel = 0
  85. mainFrame.Position = UDim2.new(0.393801957, 0, 0.326380372, 0)
  86. mainFrame.Size = UDim2.new(0, 404, 0, 282)
  87.  
  88. mainFrameUICorner.CornerRadius = UDim.new(0.0199999996, 1)
  89. mainFrameUICorner.Parent = mainFrame
  90.  
  91. mainFrameShadow.Name = "Shadow"
  92. mainFrameShadow.Parent = mainFrame
  93. mainFrameShadow.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  94. mainFrameShadow.BackgroundTransparency = 1.000
  95. mainFrameShadow.Position = UDim2.new(-0.055555556, 0, -0.0496453904, 0)
  96. mainFrameShadow.Size = UDim2.new(0, 448, 0, 311)
  97. mainFrameShadow.Image = "rbxassetid://5554236805"
  98. mainFrameShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
  99.  
  100. topBarFrame.Name = "TopBar"
  101. topBarFrame.Parent = mainFrame
  102. topBarFrame.BackgroundColor3 = colors.TopBar
  103. topBarFrame.Size = UDim2.new(0, 404, 0, 32)
  104.  
  105. topBarUICorner.CornerRadius = UDim.new(0.200000003, 1)
  106. topBarUICorner.Parent = topBarFrame
  107.  
  108. titleTextLabel.Parent = topBarFrame
  109. titleTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  110. titleTextLabel.BackgroundTransparency = 1.000
  111. titleTextLabel.Position = UDim2.new(0.0262425486, 0, 0, 0)
  112. titleTextLabel.Size = UDim2.new(0, 120, 0, 29)
  113. titleTextLabel.Font = Enum.Font.GothamSemibold
  114. titleTextLabel.Text = title
  115. titleTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  116. titleTextLabel.TextSize = 14.000
  117. titleTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  118.  
  119. closeImageButton.Parent = topBarFrame
  120. closeImageButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  121. closeImageButton.BackgroundTransparency = 1.000
  122. closeImageButton.Position = UDim2.new(0.931999981, 0, 0.172000006, 0)
  123. closeImageButton.Size = UDim2.new(0, 19, 0, 19)
  124. closeImageButton.Image = "rbxassetid://6031094678"
  125.  
  126. tabBarFrame.Name = "TabBar"
  127. tabBarFrame.Parent = mainFrame
  128. tabBarFrame.BackgroundColor3 = colors.TabBar
  129. tabBarFrame.Position = UDim2.new(0, 0, 0.102836877, 0)
  130. tabBarFrame.Size = UDim2.new(0, 404, 0, 22)
  131. tabBarFrame.ScrollingDirection = Enum.ScrollingDirection.X
  132. tabBarFrame.BorderSizePixel = 0
  133. tabBarFrame.ScrollBarThickness = 3
  134.  
  135. tabBarFrameUICorner.CornerRadius = UDim.new(0.0500000007, 1)
  136. tabBarFrameUICorner.Parent = tabBarFrame
  137.  
  138. tabBarFrameUIGridLayout.Parent = tabBarFrame
  139. tabBarFrameUIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  140. tabBarFrameUIGridLayout.CellSize = UDim2.new(0, 90, 0, 20)
  141.  
  142. tabBarFrameUIGridLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  143. tabBarFrame.CanvasSize = UDim2.fromOffset(tabBarFrameUIGridLayout.AbsoluteContentSize.X, 0)
  144. end)
  145.  
  146. tabs.Name = "Tabs"
  147. tabs.Parent = mainFrame
  148.  
  149. local dragToggle = nil
  150. local dragSpeed = .5
  151. local dragInput = nil
  152. local dragStart = nil
  153. local dragPos = nil
  154.  
  155. mainFrame.InputBegan:Connect(function(input)
  156. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
  157. dragToggle = true
  158. dragStart = input.Position
  159. dragPos = mainFrame.Position
  160.  
  161. input.Changed:Connect(function()
  162. if (input.UserInputState == Enum.UserInputState.End) then
  163. dragToggle = false
  164. end
  165. end)
  166. end
  167. end)
  168.  
  169. mainFrame.InputChanged:Connect(function(input)
  170. if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  171. dragInput = input
  172. end
  173. end)
  174.  
  175. game:GetService("UserInputService").InputChanged:Connect(function(input)
  176. if (input == dragInput and dragToggle) then
  177. local Delta = input.Position - dragStart
  178. local Position = UDim2.new(dragPos.X.Scale, dragPos.X.Offset + Delta.X, dragPos.Y.Scale, dragPos.Y.Offset + Delta.Y)
  179. game:GetService("TweenService"):Create(mainFrame, TweenInfo.new(.25), {Position = Position}):Play()
  180. end
  181. end)
  182.  
  183. closeImageButton.MouseButton1Click:Connect(function()
  184. screenGui:Destroy()
  185. end)
  186.  
  187. screenGui.Parent = parent
  188. return setmetatable({screenGui = screenGui, colors = colors}, Window)
  189. end
  190.  
  191. function Window:IsDestroyed()
  192. return not self.screenGui
  193. end
  194.  
  195. function Window:CreateTab(title)
  196. local tab = Instance.new("ScrollingFrame")
  197. local tabUIGridLayout = Instance.new("UIGridLayout")
  198. local tabTextButton = Instance.new("TextButton")
  199. local tabTextButtonUICorner = Instance.new("UICorner")
  200.  
  201. tab.Name = "Tab"
  202. tab.Active = true
  203. tab.BackgroundTransparency = 1
  204. tab.BorderSizePixel = 0
  205. tab.Position = UDim2.new(0.0262425486, 0, 0.209219858, 0)
  206. tab.Size = UDim2.new(0, 387, 0, 215)
  207. tab.ScrollBarThickness = 3
  208. tab.Visible = false
  209.  
  210. tabUIGridLayout.Parent = tab
  211. tabUIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  212. tabUIGridLayout.CellSize = UDim2.new(0, 376, 0, 25)
  213.  
  214. tabUIGridLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  215. tab.CanvasSize = UDim2.fromOffset(tabUIGridLayout.AbsoluteContentSize.X, tabUIGridLayout.AbsoluteContentSize.Y)
  216. end)
  217.  
  218. tabTextButton.BackgroundColor3 = Color3.fromRGB(67, 67, 95)
  219. tabTextButton.BackgroundTransparency = 1.000
  220. tabTextButton.BorderColor3 = Color3.fromRGB(27, 42, 53)
  221. tabTextButton.BorderSizePixel = 0
  222. tabTextButton.Size = UDim2.new(0, 97, 0, 20)
  223. tabTextButton.Font = Enum.Font.Gotham
  224. tabTextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  225. tabTextButton.TextSize = 13.000
  226. tabTextButton.Text = title
  227.  
  228. tabTextButtonUICorner.CornerRadius = UDim.new(0.09, 1)
  229. tabTextButtonUICorner.Parent = tabTextButton
  230.  
  231. local tabindex = #self.screenGui.Main.Tabs:GetChildren() + 1
  232.  
  233. tabTextButton.MouseButton1Click:Connect(function()
  234. self:__SetCurrentTab(tabindex)
  235. end)
  236.  
  237. tabTextButton.Parent = self.screenGui.Main.TabBar
  238. tab.Parent = self.screenGui.Main.Tabs
  239.  
  240. if self.currentTab == nil then
  241. self:__SetCurrentTab(1)
  242. end
  243.  
  244. return setmetatable({frame = tab, colors = self.colors}, Tab)
  245. end
  246.  
  247. function Window:__SetCurrentTab(tabindex)
  248. if self.currentTab then
  249. self.currentTab.Visible = false
  250. end
  251.  
  252. self.currentTab = self.screenGui.Main.Tabs:GetChildren()[tabindex]
  253. self.currentTab.Visible = true
  254. end
  255.  
  256. function Tab:CreateLabel(text, highlight)
  257. local label = Instance.new("Frame")
  258. local labelUICorner = Instance.new("UICorner")
  259. local labelTextLabel = Instance.new("TextLabel")
  260. local labelImage = Instance.new("ImageLabel")
  261.  
  262. label.Name = "Label"
  263. label.BackgroundColor3 = highlight and self.colors.LabelHighlighted or self.colors.Label
  264. label.Position = UDim2.new(0, 0, -0.0141843967, 0)
  265. label.Size = UDim2.new(0, 100, 0, 100)
  266.  
  267. labelUICorner.CornerRadius = UDim.new(0.0900000036, 1)
  268. labelUICorner.Parent = label
  269.  
  270. labelTextLabel.Parent = label
  271. labelTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  272. labelTextLabel.BackgroundTransparency = 1.000
  273. labelTextLabel.Position = UDim2.new(0.0265442859, 0, 0, 0)
  274. labelTextLabel.Size = UDim2.new(0, 366, 0, 25)
  275. labelTextLabel.Font = Enum.Font.Gotham
  276. labelTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  277. labelTextLabel.TextSize = 13.000
  278. labelTextLabel.TextWrapped = true
  279. labelTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  280. labelTextLabel.Text = text
  281.  
  282. labelImage.Parent = label
  283. labelImage.BackgroundTransparency = 1.000
  284. labelImage.BorderSizePixel = 0
  285. labelImage.Position = UDim2.new(0.941197634, 0, 0.119999975, 0)
  286. labelImage.Size = UDim2.new(0, 19, 0, 19)
  287. labelImage.Image = "http://www.roblox.com/asset/?id=6035078890"
  288. labelImage.ImageTransparency = 0.300
  289.  
  290. label.Parent = self.frame
  291. return setmetatable({label = label}, Label)
  292. end
  293.  
  294. function Label:Update(newtext)
  295. self.label.TextLabel.Text = newtext
  296. end
  297.  
  298. function Tab:CreateButton(text, callback)
  299. local button = Instance.new("TextButton")
  300. local buttonUICorner = Instance.new("UICorner")
  301. local buttonTextLabel = Instance.new("TextLabel")
  302. local buttonImageLabel = Instance.new("ImageLabel")
  303.  
  304. button.Name = "Button"
  305. button.BackgroundColor3 = self.colors.Button
  306. button.BorderSizePixel = 0
  307. button.Size = UDim2.new(0, 200, 0, 50)
  308. button.Font = Enum.Font.Gotham
  309. button.Text = " "
  310. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  311. button.TextSize = 13.000
  312.  
  313. buttonUICorner.CornerRadius = UDim.new(0.09, 1)
  314. buttonUICorner.Parent = button
  315.  
  316. buttonTextLabel.Parent = button
  317. buttonTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  318. buttonTextLabel.BackgroundTransparency = 1.000
  319. buttonTextLabel.Position = UDim2.new(0.0265442859, 0, 0, 0)
  320. buttonTextLabel.Size = UDim2.new(0, 366, 0, 25)
  321. buttonTextLabel.Font = Enum.Font.Gotham
  322. buttonTextLabel.Text = text
  323. buttonTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  324. buttonTextLabel.TextSize = 13.000
  325. buttonTextLabel.TextWrapped = true
  326. buttonTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  327.  
  328. buttonImageLabel.Parent = button
  329. buttonImageLabel.BackgroundTransparency = 1.000
  330. buttonImageLabel.BorderSizePixel = 0
  331. buttonImageLabel.Position = UDim2.new(0.940150976, 0, 0.11999999, 0)
  332. buttonImageLabel.Size = UDim2.new(0, 19, 0, 19)
  333. buttonImageLabel.Image = "http://www.roblox.com/asset/?id=6026568225"
  334. buttonImageLabel.ImageTransparency = 0.300
  335.  
  336. button.MouseButton1Click:Connect(callback)
  337. button.Parent = self.frame
  338.  
  339. return button
  340. end
  341.  
  342. function Tab:CreateToggle(text, state, callback)
  343. local toggle = Instance.new("Frame")
  344. local toggleUICorner = Instance.new("UICorner")
  345. local toggleTextLabel = Instance.new("TextLabel")
  346. local toggleImageLabel = Instance.new("ImageLabel")
  347. local toggleImageButton = Instance.new("ImageButton")
  348.  
  349. toggle.Name = "Toggle"
  350. toggle.BackgroundColor3 = self.colors.Toggle
  351. toggle.Size = UDim2.new(0, 100, 0, 100)
  352.  
  353. toggleUICorner.CornerRadius = UDim.new(0.0900000036, 1)
  354. toggleUICorner.Parent = toggle
  355.  
  356. toggleTextLabel.Parent = toggle
  357. toggleTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  358. toggleTextLabel.BackgroundTransparency = 1.000
  359. toggleTextLabel.Position = UDim2.new(0.0265442859, 0, 0, 0)
  360. toggleTextLabel.Size = UDim2.new(0, 366, 0, 25)
  361. toggleTextLabel.Font = Enum.Font.Gotham
  362. toggleTextLabel.Text = text
  363. toggleTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  364. toggleTextLabel.TextSize = 13.000
  365. toggleTextLabel.TextWrapped = true
  366. toggleTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  367.  
  368. toggleImageLabel.Parent = toggle
  369. toggleImageLabel.BackgroundTransparency = 1.000
  370. toggleImageLabel.BorderSizePixel = 0
  371. toggleImageLabel.Position = UDim2.new(0.939878464, 0, 0.119999997, 0)
  372. toggleImageLabel.Size = UDim2.new(0, 19, 0, 19)
  373. toggleImageLabel.Image = "http://www.roblox.com/asset/?id=6031068430"
  374. toggleImageLabel.ImageTransparency = 0.300
  375.  
  376. toggleImageButton.Name = "Toggle"
  377. toggleImageButton.Parent = toggle
  378. toggleImageButton.BackgroundTransparency = 1.000
  379. toggleImageButton.BorderSizePixel = 0
  380. toggleImageButton.Position = UDim2.new(0.829032242, 0, 0.0799999982, 0)
  381. toggleImageButton.Size = UDim2.new(0, 20, 0, 20)
  382. toggleImageButton.Image = "rbxassetid://"..(state and ToggleOn or ToggleOff)
  383.  
  384. local toggleobj = setmetatable({state = state, toggle = toggle, callback = callback}, Toggle)
  385.  
  386. toggleImageButton.MouseButton1Click:Connect(function()
  387. toggleobj:SetState(not toggleobj.state)
  388. end)
  389.  
  390. toggle.Parent = self.frame
  391. return toggleobj
  392. end
  393.  
  394. function Toggle:SetState(state)
  395. self.state = state
  396. self.callback(state)
  397. self.toggle.Toggle.Image = "rbxassetid://"..(state and ToggleOn or ToggleOff)
  398. end
  399.  
  400. function Tab:CreateSlider(text, minvalue, maxvalue, value, callback)
  401. if value < minvalue or value > maxvalue then
  402. return error("Value can't be less than minimum value or higher than maximum value")
  403. end
  404.  
  405. local slider = Instance.new("Frame")
  406. local sliderUICorner = Instance.new("UICorner")
  407. local sliderTextLabel = Instance.new("TextLabel")
  408.  
  409. local sliderFrame = Instance.new("Frame")
  410. local sliderFrameUICorner = Instance.new("UICorner")
  411. local sliderImageButton = Instance.new("ImageButton")
  412. local sliderValue = Instance.new("TextLabel")
  413. local sliderImage = Instance.new("ImageLabel")
  414.  
  415. slider.Name = "Slider"
  416. slider.Parent = self.frame
  417. slider.BackgroundColor3 = self.colors.Slider
  418. slider.Position = UDim2.new(0, 0, -0.0141843967, 0)
  419. slider.Size = UDim2.new(0, 100, 0, 100)
  420.  
  421. sliderUICorner.CornerRadius = UDim.new(0.0900000036, 1)
  422. sliderUICorner.Parent = slider
  423.  
  424. sliderTextLabel.Parent = slider
  425. sliderTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  426. sliderTextLabel.BackgroundTransparency = 1.000
  427. sliderTextLabel.Position = UDim2.new(0.0265442859, 0, 0, 0)
  428. sliderTextLabel.Size = UDim2.new(0, 366, 0, 25)
  429. sliderTextLabel.Font = Enum.Font.Gotham
  430. sliderTextLabel.Text = text
  431. sliderTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  432. sliderTextLabel.TextSize = 13.000
  433. sliderTextLabel.TextWrapped = true
  434. sliderTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  435.  
  436. sliderFrame.Parent = slider
  437. sliderFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 54)
  438. sliderFrame.Position = UDim2.new(0.577000022, 0, 0.360000014, 0)
  439. sliderFrame.Size = UDim2.new(0, 114, 0, 5)
  440.  
  441. sliderFrameUICorner.CornerRadius = UDim.new(32, 1)
  442. sliderFrameUICorner.Parent = sliderFrame
  443.  
  444. sliderImageButton.Parent = sliderFrame
  445. sliderImageButton.BackgroundTransparency = 1.000
  446. sliderImageButton.BorderSizePixel = 0
  447. sliderImageButton.Position = UDim2.new(-0.00877192989, 0, -1, 0)
  448. sliderImageButton.Size = UDim2.new(0, 16, 0, 16)
  449. sliderImageButton.Image = "http://www.roblox.com/asset/?id=6031625146"
  450.  
  451. sliderValue.Name = "Value"
  452. sliderValue.Parent = sliderFrame
  453. sliderValue.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  454. sliderValue.BackgroundTransparency = 1.000
  455. sliderValue.Position = UDim2.new(-0.340803713, 0, -1, 0)
  456. sliderValue.Size = UDim2.new(0, 38, 0, 16)
  457. sliderValue.Font = Enum.Font.Gotham
  458. sliderValue.Text = value
  459. sliderValue.TextColor3 = Color3.fromRGB(255, 255, 255)
  460. sliderValue.TextSize = 13.000
  461. sliderValue.TextWrapped = true
  462. sliderValue.TextXAlignment = Enum.TextXAlignment.Left
  463.  
  464. sliderImage.Parent = slider
  465. sliderImage.BackgroundTransparency = 1.000
  466. sliderImage.BorderSizePixel = 0
  467. sliderImage.Position = UDim2.new(0.941197634, 0, 0.119999975, 0)
  468. sliderImage.Size = UDim2.new(0, 19, 0, 19)
  469. sliderImage.Image = "http://www.roblox.com/asset/?id=6031233863"
  470. sliderImage.ImageTransparency = 0.300
  471.  
  472. local sliderobj = setmetatable({imagebutton = sliderImageButton, slidervalue = sliderValue, callback = callback, minvalue = minvalue, maxvalue = maxvalue}, Slider)
  473. sliderobj:SetValue(value)
  474.  
  475. local dragging = false
  476.  
  477. sliderImageButton.MouseButton1Down:Connect(function()
  478. dragging = true
  479. end)
  480.  
  481. UserInput.InputChanged:Connect(function()
  482. if dragging then
  483. local mousePos = UserInput:GetMouseLocation() + Vector2.new(0, 36)
  484. local relPos = mousePos - sliderFrame.AbsolutePosition
  485. local precent = math.clamp(relPos.X / sliderFrame.AbsoluteSize.X, 0, 1)
  486. local newvalue = util_lerp(minvalue, maxvalue, precent)
  487.  
  488. sliderImageButton.Position = UDim2.new(precent, 0, sliderImageButton.Position.Y.Scale, 0)
  489. sliderValue.Text = newvalue
  490. callback(newvalue)
  491. end
  492. end)
  493.  
  494. UserInput.InputEnded:Connect(function(input)
  495. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  496. dragging = false
  497. end
  498. end)
  499.  
  500. return sliderobj
  501. end
  502.  
  503. function Slider:SetValue(newvalue)
  504. if newvalue < self.minvalue or newvalue > self.maxvalue then
  505. return error("Value can't be less than minimum value or higher than maximum value")
  506. end
  507.  
  508. self.imagebutton.Position = UDim2.new((newvalue - self.minvalue) / (self.maxvalue - self.minvalue), 0, self.imagebutton.Position.Y.Scale, 0)
  509. self.slidervalue.Text = newvalue
  510. self.callback(newvalue)
  511. end
  512.  
  513. function Tab:CreateTextBox(text, value, callback)
  514. local mainFrame = Instance.new("Frame")
  515. local mainFrameUICorner = Instance.new("UICorner")
  516. local mainFrameTextLabel = Instance.new("TextLabel")
  517. local mainFrameImageLabel = Instance.new("ImageLabel")
  518. local mainFrameTextBox = Instance.new("TextBox")
  519. local mainFrameTextBoxUICorner = Instance.new("UICorner")
  520.  
  521. mainFrame.Name = "TextBox"
  522. mainFrame.Parent = self.frame
  523. mainFrame.BackgroundColor3 = self.colors.TextBox
  524. mainFrame.Position = UDim2.new(-0.0103359176, 0, -0.00886524841, 0)
  525. mainFrame.Size = UDim2.new(0, 100, 0, 100)
  526.  
  527. mainFrameUICorner.CornerRadius = UDim.new(0.0900000036, 1)
  528. mainFrameUICorner.Parent = mainFrame
  529.  
  530. mainFrameTextLabel.Parent = mainFrame
  531. mainFrameTextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  532. mainFrameTextLabel.BackgroundTransparency = 1.000
  533. mainFrameTextLabel.Position = UDim2.new(0.0265442859, 0, 0, 0)
  534. mainFrameTextLabel.Size = UDim2.new(0, 366, 0, 25)
  535. mainFrameTextLabel.Font = Enum.Font.Gotham
  536. mainFrameTextLabel.Text = text
  537. mainFrameTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  538. mainFrameTextLabel.TextSize = 13.000
  539. mainFrameTextLabel.TextWrapped = true
  540. mainFrameTextLabel.TextXAlignment = Enum.TextXAlignment.Left
  541.  
  542. mainFrameImageLabel.Parent = mainFrame
  543. mainFrameImageLabel.BackgroundTransparency = 1.000
  544. mainFrameImageLabel.BorderSizePixel = 0
  545. mainFrameImageLabel.Position = UDim2.new(0.942538083, 0, 0.119999997, 0)
  546. mainFrameImageLabel.Size = UDim2.new(0, 19, 0, 19)
  547. mainFrameImageLabel.Image = "http://www.roblox.com/asset/?id=6034818398"
  548. mainFrameImageLabel.ImageTransparency = 0.300
  549.  
  550. mainFrameTextBox.Parent = mainFrame
  551. mainFrameTextBox.BackgroundColor3 = Color3.fromRGB(38, 38, 54)
  552. mainFrameTextBox.BorderSizePixel = 0
  553. mainFrameTextBox.Position = UDim2.new(0.577127635, 0, 0.119999997, 0)
  554. mainFrameTextBox.Size = UDim2.new(0, 114, 0, 19)
  555. mainFrameTextBox.Font = Enum.Font.SourceSans
  556. mainFrameTextBox.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  557. mainFrameTextBox.PlaceholderText = "Text Here"
  558. mainFrameTextBox.Text = value
  559. mainFrameTextBox.TextColor3 = Color3.fromRGB(234, 234, 234)
  560. mainFrameTextBox.TextSize = 14.000
  561. mainFrameTextBox.TextWrapped = true
  562.  
  563. mainFrameTextBoxUICorner.CornerRadius = UDim.new(0.0900000036, 1)
  564. mainFrameTextBoxUICorner.Parent = mainFrameTextBox
  565.  
  566. mainFrameTextBox.FocusLost:Connect(function(enterPressed)
  567. if enterPressed then
  568. callback(mainFrameTextBox.Text)
  569. mainFrameTextBox.Text = ""
  570. end
  571. end)
  572.  
  573. return setmetatable({textBox = mainFrameTextBox}, TextBox)
  574. end
  575.  
  576. function TextBox:SetText(newtext)
  577. self.textBox.Text = newtext
  578. end
  579.  
  580. return Window
Advertisement
Add Comment
Please, Sign In to add comment