Advertisement
GO0GL3_CHR0M3

ShouxOwlLib

Nov 15th, 2019
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.03 KB | None | 0 0
  1. local dragging = false;
  2. local draggableStart;
  3. local startPos;
  4.  
  5. local ShouxLibGui = Instance.new("ScreenGui", game:GetService("CoreGui"));
  6. local mainFrame = Instance.new("Frame", ShouxLibGui);
  7. local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint", mainFrame);
  8. local titleLabel = Instance.new("TextLabel", mainFrame);
  9. local owlIcon = Instance.new("ImageLabel", mainFrame);
  10. local categoryFrame = Instance.new("Frame", mainFrame);
  11. local categoryBodyFrame = Instance.new("Frame", mainFrame);
  12. local categoryListLayout = Instance.new("UIListLayout", categoryBodyFrame);
  13. local topPaddingFrame = Instance.new("Frame", mainFrame);
  14. local backgroundFrame = Instance.new("Frame", mainFrame);
  15. local bodyFrames = {};
  16. local watermarkLabel = Instance.new("ImageLabel", ShouxLib)
  17. local watermarkAspectratioConstraint = Instance.new("UIAspectRatioConstraint", watermarkLabel)
  18.  
  19. ShouxLibGui.Name = "ShouxLibGui";
  20.  
  21. mainFrame.Name = "mainFrame";
  22. mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30);
  23. mainFrame.BorderSizePixel = 0;
  24. mainFrame.Position = UDim2.new(0.018, 0, 0.02, 0);
  25. mainFrame.Size = UDim2.new(0.257, 0, 0.042, 0);
  26.  
  27. UIAspectRatioConstraint.AspectRatio = 7.514;
  28.  
  29. titleLabel.Name = "titleLabel";
  30. titleLabel.AnchorPoint = Vector2.new(0, 0.5);
  31. titleLabel.BackgroundTransparency = 1;
  32. titleLabel.BorderSizePixel = 0;
  33. titleLabel.Position = UDim2.new(0, 0, 0.5, 0);
  34. titleLabel.Size = UDim2.new(1, 0, 0.8, 0);
  35. titleLabel.Font = Enum.Font.GothamBold;
  36. titleLabel.Text = "N/A";
  37. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  38. titleLabel.TextScaled = true;
  39. titleLabel.TextWrapped = true;
  40.  
  41. owlIcon.Name = "owlIcon";
  42. owlIcon.AnchorPoint = Vector2.new(0, 0.5);
  43. owlIcon.BackgroundTransparency = 1;
  44. owlIcon.BorderSizePixel = 0;
  45. owlIcon.Position = UDim2.new(0, 0, 0.5, 0);
  46. owlIcon.Size = UDim2.new(0.15, 0, 0.8, 0);
  47. owlIcon.Image = "rbxassetid://4387074074";
  48. owlIcon.ImageTransparency = 0.2;
  49. owlIcon.ScaleType = Enum.ScaleType.Fit;
  50.  
  51. categoryFrame.Name = "categoryFrame";
  52. categoryFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  53. categoryFrame.BorderSizePixel = 0;
  54. categoryFrame.Position = UDim2.new(0, 0, 1, 0);
  55. categoryFrame.Size = UDim2.new(1, 0, 0, 0);
  56. categoryFrame.Visible = false;
  57. categoryFrame.ZIndex = 3;
  58.  
  59. categoryBodyFrame.Name = "categoryBodyFrame";
  60. categoryBodyFrame.BackgroundTransparency = 1;
  61. categoryBodyFrame.BorderSizePixel = 0;
  62. categoryBodyFrame.Position = UDim2.new(0, 0, 1, 0);
  63. categoryBodyFrame.Size = UDim2.new(1, 0, 0, 0);
  64. categoryBodyFrame.Visible = false;
  65. categoryBodyFrame.ZIndex = 3;
  66.  
  67. categoryListLayout.SortOrder = Enum.SortOrder.LayoutOrder;
  68. categoryListLayout.Padding = UDim.new(0, 0);
  69.  
  70. topPaddingFrame.Name = "topPaddingFrame";
  71. topPaddingFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 38);
  72. topPaddingFrame.BorderSizePixel = 0;
  73. topPaddingFrame.Position = UDim2.new(0, 0, 1, 0);
  74. topPaddingFrame.Size = UDim2.new(1, 0, 0.08, 0);
  75.  
  76. backgroundFrame.Name = "backgroundFrame";
  77. backgroundFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 38);
  78. backgroundFrame.BorderSizePixel = 0;
  79. backgroundFrame.Position = UDim2.new(0, 0, 1.08, 0);
  80. backgroundFrame.Size = UDim2.new(1, 0, 0, 0);
  81.  
  82. watermarkLabel.Name = "watermarkLabel"
  83. watermarkLabel.AnchorPoint = Vector2.new(1, 0)
  84. watermarkLabel.BackgroundTransparency = 1
  85. watermarkLabel.BorderSizePixel = 0
  86. watermarkLabel.Position = UDim2.new(0.995, 0, 0, 0)
  87. watermarkLabel.Size = UDim2.new(0.147, 0, 0.11, 0)
  88. watermarkLabel.Image = "rbxassetid://4387074835"
  89. watermarkLabel.ImageTransparency = 0.4
  90. watermarkLabel.ScaleType = Enum.ScaleType.Crop
  91.  
  92. watermarkAspectratioConstraint.AspectRatio = 1.073
  93.  
  94. mainFrame.InputBegan:Connect(function(input)
  95. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  96. if not categoryFrame.Visible then
  97. categoryFrame.Visible = true;
  98. categoryBodyFrame.Visible = true;
  99.  
  100. categoryFrame:TweenSize(UDim2.new(1, 0, (#categoryBodyFrame:GetChildren() - 1), 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  101. categoryBodyFrame:TweenSize(UDim2.new(1, 0, 1.3, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  102. elseif categoryFrame.Visible then
  103. categoryFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  104. categoryBodyFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  105. wait(0.15);
  106. categoryFrame.Visible = false;
  107. categoryBodyFrame.Visible = false;
  108. end;
  109. elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
  110. dragging = true;
  111. draggableStart = input.Position;
  112. startPos = mainFrame.AbsolutePosition;
  113. elseif input.UserInputType == Enum.UserInputType.MouseMovement then
  114. game:GetService("TweenService"):Create(mainFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(25, 25, 25)}):Play();
  115. end;
  116. end);
  117.  
  118. mainFrame.InputEnded:Connect(function(input)
  119. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  120. dragging = false;
  121. elseif input.UserInputType == Enum.UserInputType.MouseMovement then
  122. game:GetService("TweenService"):Create(mainFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play();
  123. end;
  124. end);
  125.  
  126. game:GetService("UserInputService").InputChanged:Connect(function(input)
  127. if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  128. local res = ShouxLibGui.AbsoluteSize;
  129. mainFrame.Position = UDim2.new((startPos.X / res.X) + ((input.Position.X / res.X) - (draggableStart.X / res.X)), 0, (startPos.Y / res.Y) + ((input.Position.Y / res.Y) - (draggableStart.Y / res.Y)), 0);
  130. end;
  131. end);
  132.  
  133. local ShouxLib = {Content = {}};
  134.  
  135. function ShouxLib:SetCategory(category)
  136. titleLabel.Text = category.title;
  137. for i, v in pairs(bodyFrames) do
  138. v.Visible = false;
  139. end;
  140. local category = bodyFrames[category.title .. "BodyFrame"];
  141. category.Visible = true;
  142. backgroundFrame.Size = UDim2.new(1, 0, (#category:GetChildren() - 1) * 1.06, 0);
  143.  
  144. categoryFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  145. categoryBodyFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  146. wait(0.15);
  147. categoryFrame.Visible = false;
  148. categoryBodyFrame.Visible = false;
  149. end;
  150.  
  151. function ShouxLib.Content:initBtnEffect(btn)
  152. btn.InputBegan:Connect(function(input)
  153. if input.UserInputType == Enum.UserInputType.MouseMovement then
  154. game:GetService("TweenService"):Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(67, 67, 67)}):Play();
  155. end;
  156. end);
  157.  
  158. btn.InputEnded:Connect(function(input)
  159. if input.UserInputType == Enum.UserInputType.MouseMovement then
  160. game:GetService("TweenService"):Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(50, 50, 50)}):Play();
  161. end;
  162. end);
  163. end;
  164.  
  165. function ShouxLib.Content:Ripple(btn)
  166. spawn(function()
  167. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  168. local rippleEffect = Instance.new("ImageLabel", btn);
  169. local rippleEffectInner = Instance.new("ImageLabel", rippleEffect);
  170. rippleEffect.Name = "rippleEffect";
  171. rippleEffect.BackgroundTransparency = 1;
  172. rippleEffect.BorderSizePixel = 0;
  173. rippleEffect.Image = "rbxassetid://2708891598";
  174. rippleEffect.ImageColor3 = Color3.fromRGB(244, 244, 244);
  175. rippleEffect.ImageTransparency = 0.7;
  176. rippleEffect.ScaleType = Enum.ScaleType.Fit;
  177. rippleEffectInner.Name = "rippleEffect";
  178. rippleEffectInner.AnchorPoint = Vector2.new(0.5, 0.5);
  179. rippleEffectInner.BackgroundTransparency = 1;
  180. rippleEffectInner.BorderSizePixel = 0;
  181. rippleEffectInner.Position = UDim2.new(0.5, 0, 0.5, 0);
  182. rippleEffectInner.Size = UDim2.new(0.93, 0, 0.93, 0);
  183. rippleEffectInner.Image = "rbxassetid://2708891598";
  184. rippleEffectInner.ImageColor3 = Color3.fromRGB(45, 45, 45);
  185. rippleEffectInner.ImageTransparency = 0.7;
  186. rippleEffectInner.ScaleType = Enum.ScaleType.Fit;
  187. rippleEffect.Position = UDim2.new((mouse.X - rippleEffect.AbsolutePosition.X) / btn.AbsoluteSize.X, 0, (mouse.Y - rippleEffect.AbsolutePosition.Y) / btn.AbsoluteSize.Y, 0);
  188. rippleEffect:TweenSizeAndPosition(UDim2.new(10, 0, 10, 0), UDim2.new(-4.5, 0, -4.5, 0), "Out", "Quad", 0.33);
  189. for i = 1, 10 do
  190. rippleEffect.ImageTransparency = rippleEffect.ImageTransparency + 0.01;
  191. wait();
  192. end;
  193. rippleEffect:Destroy();
  194. end)
  195. end;
  196.  
  197. function ShouxLib:new(title, backgroundColor, textColor)
  198. local self = setmetatable({}, {__index = self.Content});
  199.  
  200. self.title = title;
  201. self.bodyFrame = Instance.new("Frame", mainFrame);
  202. local bodyListLayout = Instance.new("UIListLayout", self.bodyFrame);
  203. local categoryBtn = Instance.new("TextButton", categoryBodyFrame);
  204.  
  205. bodyFrames[title .. "BodyFrame"] = self.bodyFrame;
  206.  
  207. self.bodyFrame.Name = title .. "BodyFrame";
  208. self.bodyFrame.BackgroundTransparency = 1;
  209. self.bodyFrame.BorderSizePixel = 0;
  210. self.bodyFrame.Position = UDim2.new(0, 0, 1.08, 0);
  211. self.bodyFrame.Size = UDim2.new(1, 0, 1, 0);
  212. self.bodyFrame.Visible = false;
  213.  
  214. bodyListLayout.SortOrder = Enum.SortOrder.LayoutOrder;
  215. bodyListLayout.Padding = UDim.new(0.16, 0);
  216.  
  217. categoryBtn.Name = "categoryBtn";
  218. categoryBtn.BackgroundColor3 = backgroundColor or Color3.fromRGB(25, 25, 25);
  219. categoryBtn.BorderSizePixel = 0;
  220. categoryBtn.AutoButtonColor = false;
  221. categoryBtn.Size = UDim2.new(1, 0, 1, 0);
  222. categoryBtn.Font = Enum.Font.SourceSansLight;
  223. categoryBtn.Text = string.upper(title);
  224. categoryBtn.TextColor3 = textColor or Color3.fromRGB(255, 255, 255);
  225. categoryBtn.TextScaled = true;
  226. categoryBtn.TextWrapped = true;
  227. categoryBtn.ZIndex = 3;
  228. categoryBtn.MouseButton1Click:Connect(function()
  229. ShouxLib:SetCategory(self);
  230. end);
  231.  
  232. return self;
  233. end;
  234.  
  235. function ShouxLib.Content:newBtn(title, callback, noToggle)
  236. local enabled = false;
  237. local btn = Instance.new("TextButton", self.bodyFrame);
  238. local titleLabel = Instance.new("TextLabel", btn);
  239. local sideFrame = Instance.new("Frame", btn);
  240. local statusFrame = Instance.new("Frame", sideFrame);
  241.  
  242. btn.Name = "btn";
  243. btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  244. btn.BorderSizePixel = 0;
  245. btn.Size = UDim2.new(1, 0, 0.9, 0);
  246. btn.AutoButtonColor = false;
  247. btn.Font = Enum.Font.SourceSansLight;
  248. btn.Text = "";
  249. btn.TextScaled = true;
  250. btn.TextWrapped = true;
  251. btn.ClipsDescendants = true;
  252.  
  253. titleLabel.Name = "titleLabel";
  254. titleLabel.AnchorPoint = Vector2.new(0, 0.5);
  255. titleLabel.BackgroundTransparency = 1;
  256. titleLabel.BorderSizePixel = 0;
  257. titleLabel.Position = UDim2.new(0.02, 0, 0.5, 0);
  258. titleLabel.Size = UDim2.new(0.98, 0, 1, 0);
  259. titleLabel.Font = Enum.Font.SourceSansLight;
  260. titleLabel.Text = title;
  261. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  262. titleLabel.TextScaled = true;
  263. titleLabel.TextWrapped = true;
  264. titleLabel.TextXAlignment = Enum.TextXAlignment.Left;
  265.  
  266. if not noToggle then
  267. sideFrame.Name = "sideFrame";
  268. sideFrame.AnchorPoint = Vector2.new(1, 0);
  269. sideFrame.BackgroundColor3 = Color3.fromRGB(63, 63, 63);
  270. sideFrame.BorderSizePixel = 0;
  271. sideFrame.Position = UDim2.new(1, 0, 0, 0);
  272. sideFrame.Size = UDim2.new(0.223, 0, 1, 0);
  273.  
  274. statusFrame.Name = "statusFrame";
  275. statusFrame.AnchorPoint = Vector2.new(0.5, 0.5);
  276. statusFrame.BackgroundColor3 = Color3.fromRGB(180, 0, 0);
  277. statusFrame.BorderSizePixel = 0;
  278. statusFrame.Position = UDim2.new(0.5, 0, 0.5, 0);
  279. statusFrame.Size = UDim2.new(0.85, 0, 0.79, 0);
  280. end;
  281.  
  282. self:initBtnEffect(btn);
  283.  
  284. btn.MouseButton1Click:Connect(function()
  285. self:Ripple(btn);
  286. enabled = not enabled;
  287. if not noToggle then
  288. if enabled then
  289. game:GetService("TweenService"):Create(statusFrame, TweenInfo.new(0.33, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(0, 194, 94)}):Play();
  290. elseif not enabled then
  291. game:GetService("TweenService"):Create(statusFrame, TweenInfo.new(0.33, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(180, 0, 0)}):Play();
  292. end;
  293. end;
  294. callback(enabled);
  295. end);
  296. end;
  297.  
  298. function ShouxLib.Content:newSlider(title, callback, min, max, startPoint)
  299. local dragging = false;
  300. local sliderFrame = Instance.new("Frame", self.bodyFrame);
  301. local slidingFrame = Instance.new("Frame", sliderFrame);
  302. local titleLabel = Instance.new("TextLabel", sliderFrame);
  303.  
  304. sliderFrame.Name = "sliderFrame";
  305. sliderFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  306. sliderFrame.BorderSizePixel = 0;
  307. sliderFrame.Size = UDim2.new(1, 0, 0.9, 0);
  308.  
  309. slidingFrame.Name = "slidingFrame";
  310. slidingFrame.BackgroundColor3 = Color3.fromRGB(68, 68, 68);
  311. slidingFrame.BorderSizePixel = 0;
  312. slidingFrame.Size = UDim2.new((startPoint or 0) / max, 0, 1, 0);
  313.  
  314. titleLabel.Name = "titleLabel";
  315. titleLabel.AnchorPoint = Vector2.new(0, 0.5);
  316. titleLabel.BackgroundTransparency = 1;
  317. titleLabel.BorderSizePixel = 0;
  318. titleLabel.Position = UDim2.new(0.02, 0, 0.5, 0);
  319. titleLabel.Size = UDim2.new(0.98, 0, 1, 0);
  320. titleLabel.Font = Enum.Font.SourceSansLight;
  321. titleLabel.Text = title .. " | " .. tostring(startPoint and math.floor((startPoint / max) * (max - min) + min) or 0);
  322. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  323. titleLabel.TextScaled = true;
  324. titleLabel.TextWrapped = true;
  325. titleLabel.TextXAlignment = Enum.TextXAlignment.Left;
  326.  
  327. local function slide(input)
  328. local pos = UDim2.new(math.clamp((input.Position.X - sliderFrame.AbsolutePosition.X) / sliderFrame.AbsoluteSize.X, 0, 1), 0, 1, 0);
  329. slidingFrame:TweenSize(pos, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  330. local value = math.floor(((pos.X.Scale * max) / max) * (max - min) + min);
  331. titleLabel.Text = title .. " | " .. tostring(value);
  332. callback(value);
  333. end;
  334.  
  335. sliderFrame.InputBegan:Connect(function(input)
  336. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  337. dragging = true;
  338. end;
  339. end);
  340.  
  341. sliderFrame.InputEnded:Connect(function(input)
  342. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  343. dragging = false;
  344. end;
  345. end);
  346.  
  347. sliderFrame.InputBegan:Connect(function(input)
  348. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  349. slide(input);
  350. end;
  351. end);
  352.  
  353. game:GetService("UserInputService").InputChanged:Connect(function(input)
  354. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  355. slide(input);
  356. end;
  357. end);
  358. end;
  359.  
  360. function ShouxLib.Content:newBind(title, callback, presetKeyCode)
  361. local enabled = false;
  362. local listening = false;
  363. local activated = presetKeyCode and true or false;
  364. local keyCode = presetKeyCode;
  365. local bindFrame = Instance.new("Frame", self.bodyFrame);
  366. local bindBtn = Instance.new("TextButton", bindFrame);
  367. local titleLabel = Instance.new("TextLabel", bindFrame);
  368.  
  369. bindFrame.Name = "bindFrame";
  370. bindFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  371. bindFrame.BorderSizePixel = 0;
  372. bindFrame.Size = UDim2.new(1, 0, 0.9, 0);
  373.  
  374. bindBtn.Name = "bindBtn";
  375. bindBtn.AnchorPoint = Vector2.new(1, 0);
  376. bindBtn.BackgroundColor3 = Color3.fromRGB(63, 63, 63);
  377. bindBtn.BorderSizePixel = 0;
  378. bindBtn.Position = UDim2.new(1, 0, 0, 0);
  379. bindBtn.Size = UDim2.new(0.206, 0, 1, 0);
  380. bindBtn.AutoButtonColor = false;
  381. bindBtn.Font = Enum.Font.SourceSansItalic;
  382. bindBtn.Text = presetKeyCode and tostring(string.char(presetKeyCode.Value)) or "KEY";
  383. bindBtn.TextColor3 = Color3.fromRGB(255, 255, 255);
  384. bindBtn.TextScaled = true;
  385. bindBtn.TextWrapped = true;
  386.  
  387. titleLabel.Name = "titleLabel";
  388. titleLabel.AnchorPoint = Vector2.new(0, 0.5);
  389. titleLabel.BackgroundTransparency = 1
  390. titleLabel.BorderSizePixel = 0
  391. titleLabel.Position = UDim2.new(0.02, 0, 0.5, 0);
  392. titleLabel.Size = UDim2.new(0.98, 0, 1, 0);
  393. titleLabel.Font = Enum.Font.SourceSansLight;
  394. titleLabel.Text = title;
  395. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  396. titleLabel.TextScaled = true;
  397. titleLabel.TextWrapped = true;
  398. titleLabel.TextXAlignment = Enum.TextXAlignment.Left;
  399.  
  400. game:GetService("UserInputService").InputBegan:Connect(function(input, onGui)
  401. if onGui then return; end;
  402.  
  403. if listening and not activated then
  404. pcall(function()
  405. bindBtn.Text = tostring(string.char(input.KeyCode.Value));
  406. listening = false;
  407. keyCode = input.KeyCode;
  408. activated = true;
  409. end);
  410. elseif activated and not listening and input.KeyCode == keyCode then
  411. enabled = not enabled;
  412.  
  413. callback(enabled);
  414. end;
  415. end);
  416.  
  417. bindBtn.MouseButton1Click:Connect(function()
  418. bindBtn.Text = "...";
  419.  
  420. activated = false;
  421. listening = true;
  422. end);
  423. end;
  424.  
  425. function ShouxLib.Content:newDropdown(title, callback, list)
  426. local dropdownBtn = Instance.new("TextButton", self.bodyFrame);
  427. local titleLabel = Instance.new("TextLabel", dropdownBtn);
  428. local dropdownImage = Instance.new("ImageLabel", dropdownBtn);
  429. local topPaddingFrame = Instance.new("Frame", dropdownBtn);
  430. local dropdownFrame = Instance.new("Frame", dropdownBtn);
  431. local bodyFrame = Instance.new("Frame", dropdownBtn);
  432. local UIListLayout = Instance.new("UIListLayout", bodyFrame);
  433.  
  434. dropdownBtn.Name = "dropdownBtn";
  435. dropdownBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  436. dropdownBtn.BorderSizePixel = 0;
  437. dropdownBtn.Size = UDim2.new(1, 0, 0.9, 0);
  438. dropdownBtn.AutoButtonColor = false;
  439. dropdownBtn.Font = Enum.Font.SourceSansLight;
  440. dropdownBtn.Text = "";
  441. dropdownBtn.TextScaled = true;
  442. dropdownBtn.TextWrapped = true;
  443.  
  444. titleLabel.Name = "titleLabel";
  445. titleLabel.AnchorPoint = Vector2.new(0.5, 0.5);
  446. titleLabel.BackgroundTransparency = 1;
  447. titleLabel.BorderSizePixel = 0;
  448. titleLabel.Position = UDim2.new(0.5, 0, 0.5, 0);
  449. titleLabel.Size = UDim2.new(0.98, 0, 1, 0);
  450. titleLabel.Font = Enum.Font.SourceSansLight;
  451. titleLabel.Text = title;
  452. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  453. titleLabel.TextScaled = true;
  454. titleLabel.TextWrapped = true;
  455.  
  456. dropdownImage.Name = "dropdownImage";
  457. dropdownImage.AnchorPoint = Vector2.new(1, 0.5);
  458. dropdownImage.BackgroundTransparency = 1;
  459. dropdownImage.BorderSizePixel = 0;
  460. dropdownImage.Position = UDim2.new(1., 0, 0.5, 0);
  461. dropdownImage.Rotation = 180;
  462. dropdownImage.Size = UDim2.new(0.138, 0, 0.5, 0);
  463. dropdownImage.Image = "rbxassetid://3905579436";
  464. dropdownImage.ScaleType = Enum.ScaleType.Fit;
  465.  
  466. topPaddingFrame.Name = "topPaddingFrame";
  467. topPaddingFrame.BackgroundColor3 = Color3.fromRGB(63, 63, 63);
  468. topPaddingFrame.BorderSizePixel = 0;
  469. topPaddingFrame.Position = UDim2.new(0, 0, 1, 0);
  470. topPaddingFrame.Size = UDim2.new(1, 0, 0, 0);
  471. topPaddingFrame.ZIndex = 2;
  472. topPaddingFrame.Visible = false;
  473.  
  474. dropdownFrame.Name = "dropdownFrame";
  475. dropdownFrame.BackgroundColor3 = Color3.fromRGB(63, 63, 63);
  476. dropdownFrame.BorderSizePixel = 0;
  477. dropdownFrame.Position = UDim2.new(0, 0, 1.08, 0);
  478. dropdownFrame.Size = UDim2.new(1, 0, 0, 0);
  479. dropdownFrame.ZIndex = 2;
  480. dropdownFrame.Visible = false;
  481.  
  482. bodyFrame.Name = "bodyFrame";
  483. bodyFrame.BackgroundTransparency = 1;
  484. bodyFrame.BorderSizePixel = 0;
  485. bodyFrame.Position = UDim2.new(0, 0, 1.08, 0);
  486. bodyFrame.Size = UDim2.new(1, 0, 0, 0);
  487. bodyFrame.ZIndex = 2;
  488. bodyFrame.Visible = false;
  489.  
  490. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder;
  491. UIListLayout.Padding = UDim.new(0.16, 0);
  492.  
  493. self:initBtnEffect(dropdownBtn);
  494.  
  495. for i, v in pairs(list) do
  496. local btn = Instance.new("TextButton", bodyFrame);
  497. btn.Name = "btn";
  498. btn.BackgroundTransparency = 1;
  499. btn.BorderSizePixel = 0;
  500. btn.Size = UDim2.new(1, 0, 0.741, 0);
  501. btn.Font = Enum.Font.SourceSansItalic;
  502. btn.Text = v;
  503. btn.TextColor3 = Color3.fromRGB(255, 255, 255);
  504. btn.TextScaled = true;
  505. btn.TextWrapped = true;
  506. btn.ClipsDescendants = true;
  507. btn.ZIndex = 2;
  508.  
  509. btn.InputBegan:Connect(function(input)
  510. if input.UserInputType == Enum.UserInputType.MouseMovement then
  511. game:GetService("TweenService"):Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5}):Play();
  512. end;
  513. end);
  514.  
  515. btn.InputEnded:Connect(function(input)
  516. if input.UserInputType == Enum.UserInputType.MouseMovement then
  517. game:GetService("TweenService"):Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play();
  518. end;
  519. end);
  520.  
  521. btn.MouseButton1Click:Connect(function()
  522. callback(v);
  523. end);
  524. end;
  525.  
  526. dropdownBtn.MouseButton1Click:Connect(function()
  527. if not dropdownFrame.Visible then
  528. topPaddingFrame.Visible = true;
  529. dropdownFrame.Visible = true;
  530. bodyFrame.Visible = true;
  531. game:GetService("TweenService"):Create(dropdownImage, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = 0}):Play();
  532. topPaddingFrame:TweenSize(UDim2.new(1, 0, 0.08, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  533. dropdownFrame:TweenSize(UDim2.new(1, 0, (#bodyFrame:GetChildren() - 1) * 1.082, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  534. bodyFrame:TweenSize(UDim2.new(1, 0, 1.2, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  535. elseif dropdownFrame.Visible then
  536. game:GetService("TweenService"):Create(dropdownImage, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = 180}):Play();
  537. dropdownFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  538. bodyFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  539. wait(0.15);
  540. bodyFrame.Visible = false;
  541. dropdownFrame.Visible = false;
  542. topPaddingFrame.Visible = false;
  543. end;
  544. end);
  545. end;
  546.  
  547. function ShouxLib.Content:newColorPicker(title, callback, presetColor)
  548. local hueSatDragging = false;
  549. local valueDragging = false;
  550. local btn = Instance.new("TextButton", self.bodyFrame);
  551. local titleLabel = Instance.new("TextLabel", btn);
  552. local statusFrame = Instance.new("Frame", btn);
  553. local colorPickingFrame = Instance.new("Frame", btn);
  554. local hueSatFrame = Instance.new("ImageLabel", colorPickingFrame);
  555. local hueSatIndicatorFrame = Instance.new("ImageLabel", hueSatFrame);
  556. local valueFrame = Instance.new("ImageLabel", colorPickingFrame);
  557. local valueIndicatorFrame = Instance.new("Frame", valueFrame);
  558.  
  559. btn.Name = "btn";
  560. btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50);
  561. btn.BorderSizePixel = 0;
  562. btn.Size = UDim2.new(1, 0, 0.9, 0);
  563. btn.AutoButtonColor = false;
  564. btn.Font = Enum.Font.SourceSansLight;
  565. btn.Text = "";
  566. btn.TextScaled = true;
  567. btn.TextWrapped = true;
  568.  
  569. titleLabel.Name = "titleLabel";
  570. titleLabel.AnchorPoint = Vector2.new(0, 0.5);
  571. titleLabel.BackgroundTransparency = 1;
  572. titleLabel.BorderSizePixel = 0;
  573. titleLabel.Position = UDim2.new(0.02, 0, 0.5, 0);
  574. titleLabel.Size = UDim2.new(0.98, 0, 1, 0);
  575. titleLabel.Font = Enum.Font.SourceSansLight;
  576. titleLabel.Text = title;
  577. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255);
  578. titleLabel.TextScaled = true;
  579. titleLabel.TextWrapped = true;
  580. titleLabel.TextXAlignment = Enum.TextXAlignment.Left;
  581.  
  582. statusFrame.Name = "statusFrame";
  583. statusFrame.AnchorPoint = Vector2.new(1, 0);
  584. statusFrame.BackgroundColor3 = presetColor or Color3.fromRGB(255, 255, 255);
  585. statusFrame.BorderSizePixel = 0;
  586. statusFrame.Position = UDim2.new(1, 0, 0, 0);
  587. statusFrame.Size = UDim2.new(0.223, 0, 1, 0);
  588.  
  589. colorPickingFrame.Name = "colorPickingFrame";
  590. colorPickingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30);
  591. colorPickingFrame.BorderSizePixel = 0;
  592. colorPickingFrame.Position = UDim2.new(0, 0, 1, 0);
  593. colorPickingFrame.Size = UDim2.new(1, 0, 0, 0);
  594. colorPickingFrame.Visible = false;
  595. colorPickingFrame.ZIndex = 2;
  596.  
  597. hueSatFrame.Name = "hueSatFrame";
  598. hueSatFrame.BackgroundTransparency = 1;
  599. hueSatFrame.BorderSizePixel = 0;
  600. hueSatFrame.ClipsDescendants = true;
  601. hueSatFrame.Position = UDim2.new(0.03, 0, 0.057, 0);
  602. hueSatFrame.Size = UDim2.new(0.764, 0, 0.886, 0);
  603. hueSatFrame.Image = "rbxassetid://4018903152";
  604. hueSatFrame.ZIndex = 2;
  605.  
  606. hueSatIndicatorFrame.Name = "indicatorFrame";
  607. hueSatIndicatorFrame.AnchorPoint = Vector2.new(0.5, 0.5);
  608. hueSatIndicatorFrame.BackgroundTransparency = 1;
  609. hueSatIndicatorFrame.BorderSizePixel = 0;
  610. hueSatIndicatorFrame.Position = UDim2.new(presetColor and select(1, Color3.toHSV(presetColor)) or 0, 0, presetColor and 1 - select(2, Color3.toHSV(presetColor)) or 0, 0);
  611. hueSatIndicatorFrame.Size = UDim2.new(0.146, 0, 0.2, 0);
  612. hueSatIndicatorFrame.Image = "rbxassetid://4019495410";
  613. hueSatIndicatorFrame.ImageColor3 = Color3.fromRGB(0, 0, 0);
  614. hueSatIndicatorFrame.ScaleType = Enum.ScaleType.Crop;
  615. hueSatIndicatorFrame.ZIndex = 2;
  616.  
  617. valueFrame.Name = "valueFrame"
  618. valueFrame.AnchorPoint = Vector2.new(1, 0)
  619. valueFrame.BackgroundTransparency = 1
  620. valueFrame.BorderSizePixel = 0;
  621. valueFrame.Position = UDim2.new(0.981, 0, 0.057, 0);
  622. valueFrame.Size = UDim2.new(0.157, 0, 0.886, 0);
  623. valueFrame.Image = "rbxassetid://4019265005";
  624. valueFrame.ImageColor3 = presetColor and Color3.fromHSV(Color3.toHSV(presetColor)) or Color3.fromRGB(255, 255, 255);
  625. valueFrame.ScaleType = Enum.ScaleType.Crop;
  626. valueFrame.ZIndex = 2;
  627.  
  628. valueIndicatorFrame.Name = "indicatorFrame";
  629. valueIndicatorFrame.AnchorPoint = Vector2.new(0, 0.5);
  630. valueIndicatorFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  631. valueIndicatorFrame.BorderColor3 = Color3.fromRGB(0, 0, 0);
  632. valueIndicatorFrame.BorderSizePixel = 2;
  633. valueIndicatorFrame.Position = UDim2.new(0, 0, presetColor and 1 - select(3, Color3.toHSV(presetColor)) or 0, 0);
  634. valueIndicatorFrame.Size = UDim2.new(1, 0, 0.028, 0);
  635. valueIndicatorFrame.ZIndex = 2;
  636.  
  637. self:initBtnEffect(btn);
  638.  
  639. btn.MouseButton1Click:Connect(function()
  640. if not colorPickingFrame.Visible then
  641. colorPickingFrame.Visible = true;
  642. colorPickingFrame:TweenSize(UDim2.new(1, 0, 5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  643. elseif colorPickingFrame.Visible then
  644. colorPickingFrame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  645. wait(0.15);
  646. colorPickingFrame.Visible = false;
  647. end;
  648. end);
  649.  
  650. hueSatFrame.InputBegan:Connect(function(input)
  651. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  652. hueSatDragging = true;
  653. end;
  654. end);
  655.  
  656. hueSatFrame.InputEnded:Connect(function(input)
  657. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  658. hueSatDragging = false;
  659. end;
  660. end);
  661.  
  662. valueFrame.InputBegan:Connect(function(input)
  663. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  664. valueDragging = true;
  665. end;
  666. end)
  667.  
  668. valueFrame.InputEnded:Connect(function(input)
  669. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  670. valueDragging = false;
  671. end;
  672. end);
  673.  
  674. game:GetService("UserInputService").InputChanged:Connect(function(input)
  675. if hueSatDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  676. hueSatIndicatorFrame.Position = UDim2.new(math.clamp((input.Position.X - hueSatFrame.AbsolutePosition.X) / hueSatFrame.AbsoluteSize.X, 0, 1), 0, math.clamp((input.Position.Y - hueSatFrame.AbsolutePosition.Y) / hueSatFrame.AbsoluteSize.Y, 0, 1), 0);
  677. valueIndicatorFrame.BackgroundColor3 = Color3.fromHSV(h, 1 - (1 - hueSatIndicatorFrame.Position.Y.Scale), 1);
  678. statusFrame.BackgroundColor3 = Color3.fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1 - valueIndicatorFrame.Position.Y.Scale);
  679. valueFrame.ImageColor3 = Color3.fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1);
  680. callback(statusFrame.BackgroundColor3);
  681. elseif valueDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  682. valueIndicatorFrame.Position = UDim2.new(0, 0, math.clamp((input.Position.Y - valueFrame.AbsolutePosition.Y) / valueFrame.AbsoluteSize.Y, 0, 1), 0);
  683. valueIndicatorFrame.BackgroundColor3 = Color3.fromHSV(h, 1 - (1 - hueSatIndicatorFrame.Position.Y.Scale), 1);
  684. statusFrame.BackgroundColor3 = Color3.fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1 - valueIndicatorFrame.Position.Y.Scale);
  685. valueFrame.ImageColor3 = Color3.fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1);
  686. callback(statusFrame.BackgroundColor3);
  687. end;
  688. end);
  689. end;
  690.  
  691. return ShouxLib;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement