Advertisement
ScripterH4X

Untitled

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