Advertisement
SPYYTTT

Untitled

Mar 16th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.35 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2. local TweenService = game:GetService("TweenService")
  3.  
  4. local Coasting = Instance.new("ScreenGui")
  5. local CoastsMain = Instance.new("ImageLabel")
  6. local Topbar = Instance.new("ImageLabel")
  7. local Title = Instance.new("Frame")
  8. local LogoTitle = Instance.new("TextLabel")
  9. local TabsHolder = Instance.new("Frame")
  10. local TabButtonLayout = Instance.new("UIListLayout")
  11. local TabsBodyHolder = Instance.new("Frame")
  12. local config = {};
  13.  
  14. pcall(function()
  15. config = game:GetService("HttpService"):JSONDecode(readfile(tostring(game.PlaceId) .. ".txt"));
  16. end);
  17.  
  18. local function saveConfig()
  19. writefile(tostring(game.PlaceId) .. ".txt", game:GetService("HttpService"):JSONEncode(config));
  20. end;
  21.  
  22.  
  23. --Library Configuration
  24.  
  25. local Library = {
  26. Colors = {
  27. Topbar = Color3.fromRGB(45, 45, 45);
  28. Body = Color3.fromRGB(25, 25, 25);
  29. TabSelected = Color3.fromRGB(25, 25, 25);
  30. Section = Color3.fromRGB(35, 35, 35);
  31. CheckboxChecked = Color3.fromRGB(69, 85, 231);
  32. CheckboxUnchecked = Color3.fromRGB(35, 35, 35);
  33. Button = Color3.fromRGB(35, 35, 35);
  34. Slider = Color3.fromRGB(69, 85, 231);
  35. SliderBackground = Color3.fromRGB(35, 35, 35);
  36. Dropdown = Color3.fromRGB(35, 35, 35);
  37. DropdownButtonHover = Color3.fromRGB(45, 45, 45);
  38. Border = Color3.fromRGB(0, 0, 0);
  39. Text = Color3.fromRGB(255, 255, 255);
  40. ColorPickerMarker = Color3.fromRGB(150, 150, 150);
  41. Overbackground = Color3.fromRGB(35, 35, 35);
  42. PlaceholderText = Color3.fromRGB(255, 255, 255);
  43. };
  44.  
  45. Settings = {
  46. MainTextSize = 15;
  47. MainTextFont = Enum.Font.GothamBold;
  48. UIToggleKey = Enum.KeyCode.RightControl;
  49. TweenEasingStyle = Enum.EasingStyle.Quart;
  50. }
  51. }
  52.  
  53. --Library.Colors.
  54. --Library.Settings.
  55.  
  56. --Main
  57.  
  58. Coasting.Name = "Coasting"
  59.  
  60. Coasting.Parent = game:GetService("CoreGui")
  61.  
  62. CoastsMain.Name = "CoastsMain"
  63. CoastsMain.Parent = Coasting
  64. CoastsMain.BackgroundColor3 = Library.Colors.Border
  65. CoastsMain.BackgroundTransparency = 1
  66. CoastsMain.BorderColor3 = Library.Colors.Border
  67. CoastsMain.ClipsDescendants = true
  68. CoastsMain.BorderSizePixel = 0
  69. CoastsMain.Position = UDim2.new(0.129598662, 0, 0.130221128, 0)
  70. CoastsMain.Size = UDim2.new(0, 413, 0, 0)
  71. CoastsMain.Image = "rbxassetid://3570695787"
  72. CoastsMain.ImageColor3 = Library.Colors.Body
  73. CoastsMain.ScaleType = Enum.ScaleType.Slice
  74. CoastsMain.SliceCenter = Rect.new(100, 100, 100, 100)
  75. CoastsMain.SliceScale = 0.06
  76. CoastsMain.ImageTransparency = 1
  77.  
  78. Topbar.Name = "Topbar"
  79. Topbar.Parent = CoastsMain
  80. Topbar.BackgroundColor3 = Library.Colors.Border
  81. Topbar.BackgroundTransparency = 1
  82. Topbar.BorderColor3 = Library.Colors.Border
  83. Topbar.BorderSizePixel = 0
  84. Topbar.Position = UDim2.new(0, 0, 0, 0)
  85. Topbar.Size = UDim2.new(1, 0, 0.00403225794, 9)
  86. Topbar.Image = "rbxassetid://4530319192"
  87. Topbar.ImageColor3 = Library.Colors.Topbar
  88. Topbar.ScaleType = Enum.ScaleType.Slice
  89. Topbar.SliceCenter = Rect.new(20, 20, 480, 480)
  90. Topbar.SliceScale = 1
  91. Topbar.ImageTransparency = 1
  92.  
  93. Title.Name = "Title"
  94. Title.Parent = CoastsMain
  95. Title.BackgroundColor3 = Library.Colors.Overbackground
  96. Title.BackgroundTransparency = 1
  97. Title.BorderColor3 = Library.Colors.Border
  98. Title.BorderSizePixel = 0
  99. Title.Position = UDim2.new(0, 0, 0.0403225794, 0)
  100. Title.Size = UDim2.new(0, 102, 0, 29)
  101. Title.Visible = false
  102.  
  103. LogoTitle.Name = "LogoTitle"
  104. LogoTitle.Parent = Title
  105. LogoTitle.BackgroundColor3 = Library.Colors.Border
  106. LogoTitle.BackgroundTransparency = 1
  107. LogoTitle.BorderColor3 = Library.Colors.Border
  108. LogoTitle.BorderSizePixel = 0
  109. LogoTitle.Size = UDim2.new(0, 75, 0, 29)
  110. LogoTitle.Font = Library.Settings.MainTextFont
  111. LogoTitle.Text = " Bear Hub"
  112. LogoTitle.TextColor3 = Library.Colors.Text
  113. LogoTitle.TextSize = Library.Settings.MainTextSize
  114. LogoTitle.TextTransparency = 1
  115.  
  116. TabsHolder.Name = "TabsHolder"
  117. TabsHolder.Parent = CoastsMain
  118. TabsHolder.BackgroundColor3 = Library.Colors.Overbackground
  119. TabsHolder.BackgroundTransparency = 1
  120. TabsHolder.BorderColor3 = Library.Colors.Border
  121. TabsHolder.BorderSizePixel = 0
  122. TabsHolder.ClipsDescendants = true
  123. TabsHolder.Position = UDim2.new(0.246973366, 0, 0.0403225794, 0)
  124. TabsHolder.Size = UDim2.new(0, 311, 0, 29)
  125. TabsHolder.Visible = false
  126.  
  127. TabButtonLayout.Name = "TabButtonLayout"
  128. TabButtonLayout.Parent = TabsHolder
  129. TabButtonLayout.FillDirection = Enum.FillDirection.Horizontal
  130. TabButtonLayout.SortOrder = Enum.SortOrder.LayoutOrder
  131. TabButtonLayout.Padding = UDim.new(0, 4)
  132.  
  133. TabsBodyHolder.Name = "TabsBodyHolder"
  134. TabsBodyHolder.Parent = CoastsMain
  135. TabsBodyHolder.BackgroundColor3 = Library.Colors.Border
  136. TabsBodyHolder.BackgroundTransparency = 1
  137. TabsBodyHolder.BorderColor3 = Library.Colors.Border
  138. TabsBodyHolder.BorderSizePixel = 0
  139. TabsBodyHolder.Position = UDim2.new(0.0155901965, 0, 0.189516127, 0)
  140. TabsBodyHolder.Size = UDim2.new(0, 400, 0, 194)
  141. TabsBodyHolder.Visible = false
  142.  
  143. UserInputService.InputBegan:Connect(function(input)
  144. if input.KeyCode == Library.Settings.UIToggleKey then
  145. Coasting.Enabled = not Coasting.Enabled
  146. end
  147. end)
  148.  
  149. --Dragging
  150.  
  151. local Dragging
  152. local DragInput
  153. local DragStart
  154. local StartPosition
  155.  
  156. local function update(input)
  157. local Delta = input.Position - DragStart
  158.  
  159. TweenService:Create(CoastsMain, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(StartPosition.X.Scale, StartPosition.X.Offset + Delta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + Delta.Y)}):Play();
  160. end
  161.  
  162. Topbar.InputBegan:Connect(function(input)
  163. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  164. Dragging = true
  165. DragStart = input.Position
  166. StartPosition = CoastsMain.Position
  167.  
  168. input.Changed:Connect(function()
  169. if input.UserInputState == Enum.UserInputState.End then
  170. Dragging = false
  171. end
  172. end)
  173. end
  174. end)
  175.  
  176. Topbar.InputChanged:Connect(function(input)
  177. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  178. DragInput = input
  179. end
  180. end)
  181.  
  182. UserInputService.InputChanged:Connect(function(input)
  183. if input == DragInput and Dragging then
  184. update(input)
  185. end
  186. end)
  187.  
  188. --Hub Intro Functions
  189.  
  190. function Library:SetTab(TabName)
  191. for i, v in pairs(TabsBodyHolder:GetChildren()) do
  192. v.Visible = false
  193. end
  194.  
  195. for i, v in pairs(TabsHolder:GetChildren()) do
  196. if v:IsA("ImageButton") then
  197. v.ImageColor3 = Library.Colors.Button
  198. end
  199. end
  200.  
  201. for i, v in pairs(TabsBodyHolder:GetChildren()) do
  202. if v.Name == (TabName .. "BodyTab") then
  203. v.Visible = true
  204. end
  205. end
  206.  
  207. for i, v in pairs(TabsHolder:GetChildren()) do
  208. if v.Name == (TabName .. "TabButton") then
  209. TweenService:Create(v, TweenInfo.new(0.2, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Colors.Body}):Play()
  210. end
  211. end
  212. end
  213.  
  214.  
  215. function FadeInButtons()
  216. for i, v in pairs(TabsHolder:GetChildren()) do
  217. if v:IsA("ImageButton") then
  218. v.ImageTransparency = 1
  219. for x, y in pairs(v:GetChildren()) do
  220. if y:IsA("TextLabel") then
  221. y.TextTransparency = 1
  222. end
  223. end
  224. end
  225. end
  226.  
  227. for i, v in pairs(TabsHolder:GetChildren()) do
  228. if v:IsA("ImageButton") then
  229. TweenService:Create(v, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  230. for x, y in pairs(v:GetChildren()) do
  231. if y:IsA("TextLabel") then
  232. TweenService:Create(y, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  233. end
  234. end
  235. end
  236. end
  237. end
  238.  
  239. --Main Hub Intro
  240.  
  241. function HubIntro()
  242. FadeInButtons()
  243. TweenService:Create(LogoTitle, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  244. TweenService:Create(Topbar, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  245. TweenService:Create(TabsHolder, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  246. TweenService:Create(Title, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  247. end
  248.  
  249. function Library:Intro()
  250. wait(0.15)
  251. TweenService:Create(CoastsMain, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  252. TweenService:Create(CoastsMain, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 413, 0, 248)}):Play()
  253.  
  254. wait(0.75)
  255. Title.Visible = true
  256. TabsHolder.Visible = true
  257. TabsBodyHolder.Visible = true
  258.  
  259. wait(0.15)
  260. HubIntro()
  261. end
  262.  
  263. --UI Library
  264.  
  265. function Library:CreateTab(tabtitle)
  266. local NameTabButton = Instance.new("ImageButton")
  267. local NameTabTitle = Instance.new("TextLabel")
  268. local NameBodyTab = Instance.new("ScrollingFrame")
  269. local BodyTabLayout = Instance.new("UIListLayout")
  270.  
  271. NameTabButton.Name = (tabtitle .. "TabButton")
  272. NameTabButton.Parent = TabsHolder
  273. NameTabButton.BackgroundColor3 = Library.Colors.Border
  274. NameTabButton.BackgroundTransparency = 1
  275. NameTabButton.BorderColor3 = Library.Colors.Border
  276. NameTabButton.BorderSizePixel = 0
  277. NameTabButton.Size = UDim2.new(0, 0, 0, 29)
  278. NameTabButton.AutoButtonColor = false
  279. NameTabButton.Image = "rbxassetid://4530319192"
  280. NameTabButton.ImageColor3 = Library.Colors.Body
  281. NameTabButton.ScaleType = Enum.ScaleType.Slice
  282. NameTabButton.SliceCenter = Rect.new(20, 20, 480, 480)
  283. NameTabButton.SliceScale = 1
  284. NameTabButton.ImageTransparency = 1
  285.  
  286. NameTabTitle.Name = (tabtitle .. "TabTitle")
  287. NameTabTitle.Parent = NameTabButton
  288. NameTabTitle.BackgroundColor3 = Library.Colors.Border
  289. NameTabTitle.BackgroundTransparency = 1
  290. NameTabTitle.BorderColor3 = Library.Colors.Border
  291. NameTabTitle.BorderSizePixel = 0
  292. NameTabTitle.Size = UDim2.new(0, 0, 0, 29)
  293. NameTabTitle.Font = Library.Settings.MainTextFont
  294. NameTabTitle.Text = tabtitle
  295. NameTabTitle.TextColor3 = Library.Colors.Text
  296. NameTabTitle.TextSize = Library.Settings.MainTextSize
  297. NameTabTitle.Size = UDim2.new(0, NameTabTitle.TextBounds.X + 15, 0, 29)
  298. NameTabButton.Size = UDim2.new(0, NameTabTitle.TextBounds.X + 15, 0, 29)
  299. NameTabTitle.TextTransparency = 1
  300.  
  301. local function ExtendCanvasSize(tab)
  302. tab.CanvasSize = UDim2.new(0, 0, 0, (#tab:GetChildren() - 0) * 36)
  303. tab.CanvasPosition = Vector2.new(0, 0)
  304. end
  305.  
  306. NameBodyTab.Name = (tabtitle .. "BodyTab")
  307. NameBodyTab.Parent = TabsBodyHolder
  308. NameBodyTab.BackgroundColor3 = Library.Colors.Border
  309. NameBodyTab.BackgroundTransparency = 1
  310. NameBodyTab.BorderColor3 = Library.Colors.Border
  311. NameBodyTab.BorderSizePixel = 0
  312. NameBodyTab.Size = UDim2.new(0, 400, 0, 194)
  313. NameBodyTab.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  314. NameBodyTab.CanvasPosition = Vector2.new(0, 48.5)
  315. ExtendCanvasSize(NameBodyTab)
  316. NameBodyTab.ScrollBarThickness = 2
  317. NameBodyTab.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  318.  
  319. BodyTabLayout.Name = (tabtitle .."BodyTabLayout")
  320. BodyTabLayout.Parent = NameBodyTab
  321. BodyTabLayout.SortOrder = Enum.SortOrder.LayoutOrder
  322. BodyTabLayout.Padding = UDim.new(0, 5)
  323.  
  324. NameTabButton.MouseButton1Click:Connect(function()
  325. Library:SetTab(tabtitle)
  326. end)
  327.  
  328. local CoastsLibrary = {}
  329.  
  330. function RippleEffect(button)
  331. spawn(function()
  332. local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
  333. local RippleHolder = Instance.new("Frame")
  334. local RippleEffect = Instance.new("ImageLabel")
  335.  
  336. RippleHolder.Name = "RippleHolder"
  337. RippleHolder.Parent = button
  338. RippleHolder.BackgroundColor3 = Library.Colors.Border
  339. RippleHolder.BackgroundTransparency = 1
  340. RippleHolder.BorderColor3 = Library.Colors.Border
  341. RippleHolder.BorderSizePixel = 0
  342. RippleHolder.ClipsDescendants = true
  343. RippleHolder.Size = UDim2.new(0, 400, 0, 32)
  344.  
  345. RippleEffect.Name = "RippleEffect"
  346. RippleEffect.Parent = RippleHolder
  347. RippleEffect.BackgroundTransparency = 1
  348. RippleEffect.BorderSizePixel = 0
  349. RippleEffect.Image = "rbxassetid://2708891598"
  350. RippleEffect.ImageColor3 = Color3.fromRGB(255, 255, 255)
  351. RippleEffect.ImageTransparency = 0.8
  352. RippleEffect.ScaleType = Enum.ScaleType.Fit
  353.  
  354. RippleEffect.Position = UDim2.new((Mouse.X - RippleEffect.AbsolutePosition.X) / button.AbsoluteSize.X, 0, (Mouse.Y - RippleEffect.AbsolutePosition.Y) / button.AbsoluteSize.Y, 0)
  355. TweenService:Create(RippleEffect, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(-5.5, 0, -7.5, 0), Size = UDim2.new(12, 0, 16, 0)}):Play()
  356.  
  357. wait(0.75)
  358. TweenService:Create(RippleEffect, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  359.  
  360. wait(1)
  361. RippleHolder:Destroy()
  362. end)
  363. end
  364.  
  365. function CoastsLibrary:CreateSection(sectionname)
  366. local NameSection = Instance.new("TextLabel")
  367.  
  368. NameSection.Name = (sectionname .. "Section")
  369. NameSection.Parent = NameBodyTab
  370. NameSection.BackgroundColor3 = Library.Colors.Section
  371. NameSection.BorderColor3 = Library.Colors.Border
  372. NameSection.BorderSizePixel = 0
  373. NameSection.Size = UDim2.new(0, 400, 0, 25)
  374. NameSection.Font = Library.Settings.MainTextFont
  375. NameSection.Text = sectionname
  376. NameSection.TextColor3 = Library.Colors.Text
  377. NameSection.TextSize = Library.Settings.MainTextSize
  378.  
  379. ExtendCanvasSize(NameBodyTab)
  380. end
  381.  
  382. function CoastsLibrary:CreateButton(buttonname, action)
  383. local Button = Instance.new("TextButton")
  384.  
  385. Button.Name = (buttonname .. "Button")
  386. Button.Parent = NameBodyTab
  387. Button.BackgroundColor3 = Library.Colors.Button
  388. Button.BorderColor3 = Library.Colors.Border
  389. Button.BorderSizePixel = 0
  390. Button.ClipsDescendants = true
  391. Button.Size = UDim2.new(0, 400, 0, 25)
  392. Button.AutoButtonColor = false
  393. Button.Font = Library.Settings.MainTextFont
  394. Button.Text = buttonname
  395. Button.TextColor3 = Library.Colors.Text
  396. Button.TextSize = Library.Settings.MainTextSize
  397.  
  398. Button.MouseButton1Down:Connect(function()
  399. action()
  400. RippleEffect(Button)
  401. end)
  402.  
  403. ExtendCanvasSize(NameBodyTab)
  404. end
  405.  
  406. function CoastsLibrary:CreateCheckbox(checkboxname, action)
  407. local CheckboxHolder = Instance.new("Frame")
  408. local InfoText = Instance.new("TextLabel")
  409. local Checkbox = Instance.new("ImageButton")
  410. local ToggleAnimation = Instance.new("Frame")
  411.  
  412. local Enabled = false
  413.  
  414. CheckboxHolder.Name = (checkboxname .. "CheckboxHolder")
  415. CheckboxHolder.Parent = NameBodyTab
  416. CheckboxHolder.BackgroundColor3 = Library.Colors.Border
  417. CheckboxHolder.BackgroundTransparency = 1
  418. CheckboxHolder.BorderColor3 = Library.Colors.Border
  419. CheckboxHolder.BorderSizePixel = 0
  420. CheckboxHolder.Position = UDim2.new(0, 0, 0.170103088, 0)
  421. CheckboxHolder.Size = UDim2.new(0, 400, 0, 25)
  422.  
  423. InfoText.Name = "InfoText"
  424. InfoText.Parent = CheckboxHolder
  425. InfoText.BackgroundColor3 = Library.Colors.Border
  426. InfoText.BackgroundTransparency = 1
  427. InfoText.BorderColor3 = Library.Colors.Border
  428. InfoText.BorderSizePixel = 0
  429. InfoText.Position = UDim2.new(0.00800000038, 0, 0, 0)
  430. InfoText.Size = UDim2.new(0, 196, 0, 24)
  431. InfoText.Font = Library.Settings.MainTextFont
  432. InfoText.Text = checkboxname
  433. InfoText.TextColor3 = Library.Colors.Text
  434. InfoText.TextSize = Library.Settings.MainTextSize
  435. InfoText.TextXAlignment = Enum.TextXAlignment.Left
  436.  
  437. Checkbox.Name = (checkboxname .. "Checkbox")
  438. Checkbox.Parent = CheckboxHolder
  439. Checkbox.BackgroundColor3 = Library.Colors.Body
  440. Checkbox.BorderColor3 = Library.Colors.CheckboxChecked
  441. Checkbox.ClipsDescendants = true
  442. Checkbox.BorderSizePixel = 1
  443. Checkbox.Position = UDim2.new(0.925000012, 0, 0, 0)
  444. Checkbox.Size = UDim2.new(0, 24, 0, 24)
  445. Checkbox.AutoButtonColor = false
  446. Checkbox.Image = "rbxassetid://1202200114"
  447.  
  448. ToggleAnimation.Name = "ToggleAnimation"
  449. ToggleAnimation.Parent = Checkbox
  450. ToggleAnimation.BackgroundColor3 = Library.Colors.Body
  451. ToggleAnimation.BorderColor3 = Library.Colors.Border
  452. ToggleAnimation.BorderSizePixel = 0
  453. ToggleAnimation.Position = UDim2.new(0, 0, 0, 0)
  454. ToggleAnimation.Size = UDim2.new(0, 24, 0, 24)
  455.  
  456. Checkbox.MouseButton1Down:Connect(function()
  457. Enabled = not Enabled
  458.  
  459. if Enabled then
  460. TweenService:Create(ToggleAnimation, TweenInfo.new(0.5, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(0.966667175, 0, 0, 0), Size = UDim2.new(0, 0, 0, 24)}):Play()
  461. elseif not Enabled then
  462. TweenService:Create(ToggleAnimation, TweenInfo.new(0.5, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(0, 24, 0, 24)}):Play()
  463. end
  464.  
  465. action(Enabled)
  466. end)
  467.  
  468. ExtendCanvasSize(NameBodyTab)
  469. end
  470.  
  471. function CoastsLibrary:CreateSlider(slidername, minimumvalue, maximumvalue, startvalue, precisevalue, action)
  472. local SliderHolder = Instance.new("Frame")
  473. local SliderTitleText = Instance.new("TextLabel")
  474. local SliderValueText = Instance.new("TextLabel")
  475. local SliderBackground = Instance.new("Frame")
  476. local SlidingSlider = Instance.new("Frame")
  477.  
  478. local Dragging = false
  479. local PreciseSliderValue = precisevalue
  480.  
  481. SliderHolder.Name = (slidername .. "SliderHolder")
  482. SliderHolder.Parent = NameBodyTab
  483. SliderHolder.BackgroundColor3 = Library.Colors.Border
  484. SliderHolder.BackgroundTransparency = 1
  485. SliderHolder.BorderColor3 = Library.Colors.Border
  486. SliderHolder.BorderSizePixel = 0
  487. SliderHolder.Position = UDim2.new(0, 0, 0.453608245, 0)
  488. SliderHolder.Size = UDim2.new(0, 400, 0, 35)
  489.  
  490. SliderTitleText.Name = (slidername .. "SliderTitleText")
  491. SliderTitleText.Parent = SliderHolder
  492. SliderTitleText.BackgroundColor3 = Library.Colors.Border
  493. SliderTitleText.BackgroundTransparency = 1
  494. SliderTitleText.BorderColor3 = Library.Colors.Border
  495. SliderTitleText.BorderSizePixel = 0
  496. SliderTitleText.Position = UDim2.new(0.00800000038, 0, 0, 0)
  497. SliderTitleText.Size = UDim2.new(0, 196, 0, 24)
  498. SliderTitleText.Font = Library.Settings.MainTextFont
  499. SliderTitleText.Text = slidername
  500. SliderTitleText.TextColor3 = Library.Colors.Text
  501. SliderTitleText.TextSize = Library.Settings.MainTextSize
  502. SliderTitleText.TextXAlignment = Enum.TextXAlignment.Left
  503.  
  504. SliderValueText.Name = (slidername .. "SliderValueText")
  505. SliderValueText.Parent = SliderHolder
  506. SliderValueText.BackgroundColor3 = Library.Colors.Border
  507. SliderValueText.BackgroundTransparency = 1
  508. SliderValueText.BorderColor3 = Library.Colors.Border
  509. SliderValueText.BorderSizePixel = 0
  510. SliderValueText.Position = UDim2.new(0.498903126, 0, 0, 0)
  511. SliderValueText.Size = UDim2.new(0, 194, 0, 24)
  512. SliderValueText.Font = Library.Settings.MainTextFont
  513. SliderValueText.Text = tostring(startvalue or PreciseSliderValue and tonumber(string.format("%.2f", startvalue)))
  514. SliderValueText.TextColor3 = Library.Colors.Text
  515. SliderValueText.TextSize = Library.Settings.MainTextSize
  516. SliderValueText.TextXAlignment = Enum.TextXAlignment.Right
  517.  
  518. SliderBackground.Name = "SliderBackground"
  519. SliderBackground.Parent = SliderHolder
  520. SliderBackground.BackgroundColor3 = Library.Colors.SliderBackground
  521. SliderBackground.BorderColor3 =Library.Colors.Border
  522. SliderBackground.BorderSizePixel = 0
  523. SliderBackground.ClipsDescendants = true
  524. SliderBackground.Position = UDim2.new(0.00800000038, 0, 0.64599961, 0)
  525. SliderBackground.Size = UDim2.new(0.976000011, 0, -0.010000011, 10)
  526.  
  527. SlidingSlider.Name = "SlidingSlider"
  528. SlidingSlider.Parent = SliderBackground
  529. SlidingSlider.BackgroundColor3 = Library.Colors.Slider
  530. SlidingSlider.BorderColor3 = Library.Colors.Border
  531. SlidingSlider.BorderSizePixel = 0
  532. SlidingSlider.Position = UDim2.new(0, 0, 0, 0)
  533. SlidingSlider.Size = UDim2.new((startvalue or 0) / maximumvalue, 0, 0, 10)
  534.  
  535. local function Sliding(input)
  536. local Pos = UDim2.new(math.clamp((input.Position.X - SliderBackground.AbsolutePosition.X) / SliderBackground.AbsoluteSize.X, 0, 1), 0, 1, 0)
  537. --SlidingSlider.Size = Pos
  538. TweenService:Create(SlidingSlider, TweenInfo.new(0.10, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = Pos}):Play()
  539.  
  540. local NonSliderPreciseValue = math.floor(((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue)
  541. local SliderPreciseValue = ((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue
  542.  
  543. local Value = (PreciseSliderValue and SliderPreciseValue or NonSliderPreciseValue)
  544. Value = tonumber(string.format("%.2f", Value))
  545.  
  546. SliderValueText.Text = tostring(Value)
  547. action(Value)
  548. end;
  549.  
  550. SliderBackground.InputBegan:Connect(function(input)
  551. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  552. Dragging = true
  553. end
  554. end)
  555.  
  556. SliderBackground.InputEnded:Connect(function(input)
  557. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  558. Dragging = false
  559. end
  560. end)
  561.  
  562. SliderBackground.InputBegan:Connect(function(input)
  563. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  564. Sliding(input)
  565. end
  566. end)
  567.  
  568. game:GetService("UserInputService").InputChanged:Connect(function(input)
  569. if Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  570. Sliding(input)
  571. end
  572. end)
  573.  
  574. ExtendCanvasSize(NameBodyTab)
  575. end
  576.  
  577. function CoastsLibrary:CreateColorPicker(colorpickername, colorpickerpresetcolor, action)
  578. local ColorPickerHolder = Instance.new("Frame")
  579. local ColorPickerTitleText = Instance.new("TextLabel")
  580. local ColorPickerButton = Instance.new("TextButton")
  581. local ColorPickerMain = Instance.new("Frame")
  582. local ColorPallete = Instance.new("ImageLabel")
  583. local ColorPalleteMarker = Instance.new("ImageLabel")
  584. local ColorBrightness = Instance.new("ImageLabel")
  585. local ColorBrightnessMarker = Instance.new("Frame")
  586. local ColorRed = Instance.new("TextLabel")
  587. local ColorGreen = Instance.new("TextLabel")
  588. local ColorBlue = Instance.new("TextLabel")
  589.  
  590. local HSD = false
  591. local VD = false
  592. local ColorPickerMainOpen = false
  593.  
  594. ColorPickerHolder.Name = (colorpickername .. "ColorPickerHolder")
  595. ColorPickerHolder.Parent = NameBodyTab
  596. ColorPickerHolder.BackgroundColor3 = Library.Colors.Border
  597. ColorPickerHolder.BackgroundTransparency = 1
  598. ColorPickerHolder.BorderColor3 = Library.Colors.Border
  599. ColorPickerHolder.BorderSizePixel = 0
  600. ColorPickerHolder.Position = UDim2.new(0, 0, 0.170103088, 0)
  601. ColorPickerHolder.Size = UDim2.new(0, 400, 0, 25)
  602.  
  603. ColorPickerTitleText.Name = "ColorPickerTitleText"
  604. ColorPickerTitleText.Parent = ColorPickerHolder
  605. ColorPickerTitleText.BackgroundColor3 = Library.Colors.Border
  606. ColorPickerTitleText.BackgroundTransparency = 1
  607. ColorPickerTitleText.BorderColor3 = Library.Colors.Border
  608. ColorPickerTitleText.BorderSizePixel = 0
  609. ColorPickerTitleText.Position = UDim2.new(0.00800000038, 0, 0, 0)
  610. ColorPickerTitleText.Size = UDim2.new(0, 196, 0, 24)
  611. ColorPickerTitleText.Font = Library.Settings.MainTextFont
  612. ColorPickerTitleText.Text = colorpickername
  613. ColorPickerTitleText.TextColor3 = Library.Colors.Text
  614. ColorPickerTitleText.TextSize = Library.Settings.MainTextSize
  615. ColorPickerTitleText.TextXAlignment = Enum.TextXAlignment.Left
  616.  
  617. ColorPickerButton.Name = "ColorPickerButton"
  618. ColorPickerButton.Parent = ColorPickerHolder
  619. ColorPickerButton.BackgroundColor3 = colorpickerpresetcolor or Color3.fromRGB(255, 255, 255);
  620. ColorPickerButton.BorderColor3 = colorpickerpresetcolor or Color3.fromRGB(255, 255, 255);
  621. ColorPickerButton.BorderSizePixel = 1
  622. ColorPickerButton.Position = UDim2.new(0.925000012, 0, 0, 0)
  623. ColorPickerButton.Size = UDim2.new(0, 24, 0, 24)
  624. ColorPickerButton.AutoButtonColor = false
  625. ColorPickerButton.Font = Library.Settings.MainTextFont
  626. ColorPickerButton.Text = ""
  627. ColorPickerButton.TextColor3 = Color3.new(255, 255, 255)
  628. ColorPickerButton.TextSize = Library.Settings.MainTextSize
  629.  
  630. local Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
  631.  
  632. ColorPickerMain.Name = "ColorPickerMain"
  633. ColorPickerMain.Parent = ColorPickerHolder
  634. ColorPickerMain.BackgroundColor3 = Library.Colors.Body
  635. ColorPickerMain.BorderColor3 = Library.Colors.Border
  636. ColorPickerMain.BorderSizePixel = 0
  637. ColorPickerMain.ClipsDescendants = true
  638. ColorPickerMain.Position = UDim2.new(0.91, 1, 0.06666667, -3)
  639. ColorPickerMain.Size = UDim2.new(0, 0, 0, 130)
  640. ColorPickerMain.ZIndex = 2
  641.  
  642. ColorPallete.Name = "ColorPallete"
  643. ColorPallete.Parent = ColorPickerMain
  644. ColorPallete.BackgroundColor3 = Library.Colors.Border
  645. ColorPallete.BackgroundTransparency = 1
  646. ColorPallete.BorderColor3 = Library.Colors.Border
  647. ColorPallete.BorderSizePixel = 0
  648. ColorPallete.Position = UDim2.new(0, 5, 0, 4)
  649. ColorPallete.Size = UDim2.new(0, 119, 0, 121)
  650. ColorPallete.ZIndex = 2
  651. ColorPallete.Image = "rbxassetid://4477380641"
  652.  
  653. ColorPalleteMarker.Name = "ColorPalleteMarker"
  654. ColorPalleteMarker.Parent = ColorPallete
  655. ColorPalleteMarker.BackgroundColor3 = Library.Colors.Border
  656. ColorPalleteMarker.BackgroundTransparency = 1
  657. ColorPalleteMarker.BorderColor3 = Library.Colors.Border
  658. ColorPalleteMarker.BorderSizePixel = 0
  659. ColorPalleteMarker.Position = UDim2.new(colorpickerpresetcolor and select(1, Color3.toHSV(colorpickerpresetcolor)) or 0, 0, colorpickerpresetcolor and 1 - select(2, Color3.toHSV(colorpickerpresetcolor)) or 0, 0)
  660. ColorPalleteMarker.Size = UDim2.new(0, 0, 0.200000003, 0)
  661. ColorPalleteMarker.ZIndex = 2
  662. ColorPalleteMarker.Image = "rbxassetid://4409133510"
  663. ColorPalleteMarker.ScaleType = Enum.ScaleType.Crop
  664.  
  665. ColorBrightness.Name = "ColorBrightness"
  666. ColorBrightness.Parent = ColorPickerMain
  667. ColorBrightness.AnchorPoint = Vector2.new(1, 0)
  668. ColorBrightness.BackgroundColor3 = Library.Colors.Border
  669. ColorBrightness.BorderColor3 = Library.Colors.Border
  670. ColorBrightness.BorderSizePixel = 0
  671. ColorBrightness.Position = UDim2.new(0, 145, 0, 4)
  672. ColorBrightness.Size = UDim2.new(0, 14, 0, 121)
  673. ColorBrightness.ZIndex = 2
  674. ColorBrightness.Image = "rbxassetid://4477380092"
  675. ColorBrightness.ScaleType = Enum.ScaleType.Crop
  676.  
  677. ColorBrightnessMarker.Name = "ColorBrightnessMarker"
  678. ColorBrightnessMarker.Parent = ColorBrightness
  679. ColorBrightnessMarker.AnchorPoint = Vector2.new(0, 0.5)
  680. ColorBrightnessMarker.BackgroundColor3 = Library.Colors.ColorPickerMarker
  681. ColorBrightnessMarker.BorderColor3 = Library.Colors.Border
  682. ColorBrightnessMarker.BorderSizePixel = 1
  683. ColorBrightnessMarker.Position = UDim2.new(0, 0, 0.013245035, 0)
  684. ColorBrightnessMarker.Size = UDim2.new(1, 0, 0.0280000009, 0)
  685. ColorBrightnessMarker.ZIndex = 2
  686.  
  687. ColorRed.Name = "ColorRed"
  688. ColorRed.Parent = ColorPickerMain
  689. ColorRed.BackgroundColor3 = Library.Colors.Border
  690. ColorRed.BackgroundTransparency = 1
  691. ColorRed.BorderColor3 = Library.Colors.Border
  692. ColorRed.BorderSizePixel = 0
  693. ColorRed.Position = UDim2.new(0, 150, 0, 0)
  694. ColorRed.Size = UDim2.new(0, 55, 0, 20)
  695. ColorRed.Font = Library.Settings.MainTextFont
  696. ColorRed.Text = ("R: " .. math.floor(Red))
  697. ColorRed.TextColor3 = Color3.fromRGB(255, 40, 40)
  698. ColorRed.TextSize = Library.Settings.MainTextSize
  699. ColorRed.TextXAlignment = Enum.TextXAlignment.Left
  700. ColorRed.ZIndex = 2
  701.  
  702. ColorGreen.Name = "ColorGreen"
  703. ColorGreen.Parent = ColorPickerMain
  704. ColorGreen.BackgroundColor3 = Library.Colors.Border
  705. ColorGreen.BackgroundTransparency = 1
  706. ColorGreen.BorderColor3 = Library.Colors.Border
  707. ColorGreen.BorderSizePixel = 0
  708. ColorGreen.Position = UDim2.new(0, 150, 0, 55)
  709. ColorGreen.Size = UDim2.new(0, 55, 0, 20)
  710. ColorGreen.Font = Library.Settings.MainTextFont
  711. ColorGreen.Text = ("G: " .. math.floor(Green))
  712. ColorGreen.TextColor3 = Color3.fromRGB(94, 241, 61)
  713. ColorGreen.TextSize = Library.Settings.MainTextSize
  714. ColorGreen.TextXAlignment = Enum.TextXAlignment.Left
  715. ColorGreen.ZIndex = 2
  716.  
  717. ColorBlue.Name = "ColorBlue"
  718. ColorBlue.Parent = ColorPickerMain
  719. ColorBlue.BackgroundColor3 = Library.Colors.Border
  720. ColorBlue.BackgroundTransparency = 1
  721. ColorBlue.BorderColor3 = Library.Colors.Border
  722. ColorBlue.BorderSizePixel = 0
  723. ColorBlue.Position = UDim2.new(0, 150, 0, 110)
  724. ColorBlue.Size = UDim2.new(0, 55, 0, 20)
  725. ColorBlue.Font = Library.Settings.MainTextFont
  726. ColorBlue.Text = ("B: " .. math.floor(Blue))
  727. ColorBlue.TextColor3 = Color3.fromRGB(0, 174, 255)
  728. ColorBlue.TextSize = Library.Settings.MainTextSize
  729. ColorBlue.TextXAlignment = Enum.TextXAlignment.Left
  730. ColorBlue.ZIndex = 2
  731.  
  732. ColorPickerButton.MouseButton1Click:Connect(function()
  733. if not ColorPickerMainOpen then
  734. TweenService:Create(NameBodyTab, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 42)}):Play()
  735. --NameBodyTab.CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 42)
  736. NameBodyTab.ClipsDescendants = true
  737. CoastsMain.ClipsDescendants = true
  738. ColorPickerMainOpen = true
  739. TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, -200, 0, 130)}):Play()
  740. elseif ColorPickerMainOpen then
  741. --NameBodyTab.CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 36)
  742. TweenService:Create(NameBodyTab, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 36)}):Play()
  743. ColorPickerMainOpen = false
  744. NameBodyTab.ClipsDescendants = true
  745. CoastsMain.ClipsDescendants = true
  746. HSD = false
  747. VD = false
  748. TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 130)}):Play()
  749. end
  750. end)
  751.  
  752. ColorPallete.InputBegan:Connect(function(input)
  753. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  754. HSD = true
  755. end
  756. end)
  757.  
  758. ColorPallete.InputEnded:Connect(function(input)
  759. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  760. HSD = false
  761. end
  762. end)
  763.  
  764. ColorBrightness.InputBegan:Connect(function(input)
  765. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  766. VD = true
  767. end
  768. end)
  769.  
  770. ColorBrightness.InputEnded:Connect(function(input)
  771. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  772. VD = false
  773. end
  774. end)
  775.  
  776. game:GetService("UserInputService").InputChanged:Connect(function(input)
  777. if HSD and input.UserInputType == Enum.UserInputType.MouseMovement then
  778. Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
  779.  
  780. ColorRed.Text = ("R: " .. math.floor(Red))
  781. ColorGreen.Text = ("G: " .. math.floor(Green))
  782. ColorBlue.Text = ("B: " .. math.floor(Blue))
  783.  
  784. ColorPalleteMarker.Position = UDim2.new(math.clamp((input.Position.X - ColorPallete.AbsolutePosition.X) / ColorPallete.AbsoluteSize.X, 0, 1), 0, math.clamp((input.Position.Y - ColorPallete.AbsolutePosition.Y) / ColorPallete.AbsoluteSize.Y, 0, 1), 0)
  785.  
  786. ColorPickerButton.BackgroundColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  787. ColorPickerButton.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  788. ColorBrightnessMarker.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  789.  
  790. action(ColorPickerButton.BackgroundColor3)
  791. elseif VD and input.UserInputType == Enum.UserInputType.MouseMovement then
  792. Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
  793.  
  794. ColorRed.Text = ("R: " .. math.floor(Red))
  795. ColorGreen.Text = ("G: " .. math.floor(Green))
  796. ColorBlue.Text = ("B: " .. math.floor(Blue))
  797.  
  798. ColorBrightnessMarker.Position = UDim2.new(0, 0, math.clamp((input.Position.Y - ColorBrightness.AbsolutePosition.Y) / ColorBrightness.AbsoluteSize.Y, 0, 1), 0)
  799.  
  800. ColorPickerButton.BackgroundColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  801. ColorPickerButton.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  802. ColorBrightnessMarker.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
  803.  
  804. action(ColorPickerButton.BackgroundColor3)
  805. end
  806. end)
  807.  
  808. NameTabButton.MouseButton1Down:Connect(function()
  809. ColorPickerMainOpen = false
  810. HSD = false
  811. VD = false
  812. NameBodyTab.ClipsDescendants = true
  813. CoastsMain.ClipsDescendants = true
  814. TweenService:Create(ColorPickerMain, TweenInfo.new(0.01, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 130)}):Play()
  815. end)
  816.  
  817. ExtendCanvasSize(NameBodyTab)
  818. end
  819.  
  820.  
  821. return CoastsLibrary;
  822. end
  823.  
  824. return Library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement