Advertisement
M0nkePr0

Vibe V1

Nov 20th, 2022 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.49 KB | None | 0 0
  1. -- >>: Variables
  2.  
  3. local players = game:service('Players')
  4. local player = players.LocalPlayer
  5. local mouse = player:GetMouse()
  6. local run = game:service('RunService')
  7. local stepped = run.Stepped
  8.  
  9. local uis = game:GetService("UserInputService")
  10. local Value
  11.  
  12. local windowCount = 0
  13. local xOffset = 10
  14.  
  15. -- >>: Services
  16.  
  17. local UserInputService = game:GetService("UserInputService")
  18.  
  19. -- >>: GUI Functions
  20.  
  21. if game.CoreGui:FindFirstChild("Vibe") then
  22. game.CoreGui:FindFirstChild("Vibe"):Destroy()
  23. end
  24.  
  25. -- >>: Library
  26.  
  27. local Library = {}
  28.  
  29. function Library:CreateLibrary()
  30.  
  31. local Vibe = Instance.new("ScreenGui")
  32.  
  33. Vibe.Name = "Vibe"
  34. Vibe.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  35. Vibe.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  36. Vibe.ResetOnSpawn = false
  37.  
  38. local keybindConnection
  39.  
  40. function Library:Toggle(key)
  41. if keybindConnection then keybindConnection:Disconnect() end
  42.  
  43. keybindConnection = UserInputService.InputBegan:Connect(function(input, gp)
  44. if not gp and input.KeyCode == Enum.KeyCode[key] then
  45. Vibe.Enabled = not Vibe.Enabled
  46. end
  47. end)
  48. end
  49.  
  50. local CategoryHandler = {}
  51.  
  52. function CategoryHandler:NewCategory(Name)
  53.  
  54. windowCount = windowCount + 1
  55. local winCount = windowCount
  56. local zindex = winCount * 7
  57.  
  58. local Category = Instance.new("Frame")
  59. local CategoryName = Instance.new("TextLabel")
  60. local CategoryListing = Instance.new("UIListLayout")
  61. local Module = Instance.new("Frame")
  62. local ModuleListing = Instance.new("UIListLayout")
  63.  
  64. local function Dragify(obj)
  65. spawn(function()
  66. local minitial
  67. local initial
  68. local isdragging
  69. CategoryName.InputBegan:Connect(function(input)
  70. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  71. isdragging = true
  72. minitial = input.Position
  73. initial = obj.Position
  74. local con
  75. con = stepped:Connect(function()
  76. if isdragging then
  77. local delta = Vector3.new(mouse.X, mouse.Y, 0) - minitial
  78. obj.Position = UDim2.new(initial.X.Scale, initial.X.Offset + delta.X, initial.Y.Scale, initial.Y.Offset + delta.Y)
  79. else
  80. con:Disconnect()
  81. end
  82. end)
  83. input.Changed:Connect(function()
  84. if input.UserInputState == Enum.UserInputState.End then
  85. isdragging = false
  86. end
  87. end)
  88. end
  89. end)
  90. end)
  91. end
  92.  
  93. Category.Name = "Category"
  94. Category.Parent = Vibe
  95. Category.BackgroundColor3 = Color3.fromRGB(46, 46, 46)
  96. Category.BorderColor3 = Color3.fromRGB(42, 123, 155)
  97. Category.Position = UDim2.new(0, xOffset, 0, 20)
  98. Category.Size = UDim2.new(0, 150, 0, 0)
  99. Category.AutomaticSize = Enum.AutomaticSize.Y
  100. Dragify(Category)
  101.  
  102. xOffset = xOffset + 175
  103.  
  104. CategoryName.Name = "CategoryName"
  105. CategoryName.Parent = Category
  106. CategoryName.BackgroundColor3 = Color3.fromRGB(39, 39, 39)
  107. CategoryName.BorderColor3 = Color3.fromRGB(42, 123, 155)
  108. CategoryName.BorderSizePixel = 0
  109. CategoryName.Size = UDim2.new(1, 0, 0, 30)
  110. CategoryName.Font = Enum.Font.Nunito
  111. CategoryName.FontFace = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Bold)
  112. CategoryName.Text = Name:upper()
  113. CategoryName.TextColor3 = Color3.fromRGB(255, 255, 255)
  114. CategoryName.TextSize = 19.000
  115.  
  116. CategoryListing.Name = "CategoryListing"
  117. CategoryListing.Parent = Category
  118. CategoryListing.HorizontalAlignment = Enum.HorizontalAlignment.Center
  119. CategoryListing.SortOrder = Enum.SortOrder.LayoutOrder
  120.  
  121. Module.Name = "Module"
  122. Module.Parent = Category
  123. Module.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  124. Module.BackgroundTransparency = 1.000
  125. Module.BorderSizePixel = 0
  126. Module.Size = UDim2.new(1, 0, 0, 0)
  127.  
  128. ModuleListing.Name = "ModuleListing"
  129. ModuleListing.Parent = Module
  130. ModuleListing.HorizontalAlignment = Enum.HorizontalAlignment.Center
  131. ModuleListing.SortOrder = Enum.SortOrder.LayoutOrder
  132.  
  133. local ModuleHandler = {}
  134.  
  135. function ModuleHandler:NewModule(Name, default, callback)
  136.  
  137. local DefaultLocal = default or false
  138. local ToggleInit = {}
  139.  
  140. local ModuleButton = Instance.new("TextButton")
  141. local ModuleSettings = Instance.new("Frame")
  142. local ModuleSettingsListing = Instance.new("UIListLayout")
  143.  
  144. ModuleButton.Name = "ModuleButton"
  145. ModuleButton.Parent = Module
  146. ModuleButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  147. ModuleButton.BackgroundTransparency = 1.000
  148. ModuleButton.BorderSizePixel = 0
  149. ModuleButton.Size = UDim2.new(1, 0, 0, 30)
  150. ModuleButton.AutoButtonColor = false
  151. ModuleButton.Font = Enum.Font.Nunito
  152. ModuleButton.Text = Name
  153. ModuleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  154. ModuleButton.TextSize = 19.000
  155.  
  156. ModuleSettings.Name = "ModuleSettings"
  157. ModuleSettings.Parent = Module
  158. ModuleSettings.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  159. ModuleSettings.BackgroundTransparency = 1.000
  160. ModuleSettings.BorderSizePixel = 0
  161. ModuleSettings.Size = UDim2.new(1, 0, 0, 0)
  162. ModuleSettings.Visible = false
  163.  
  164. ModuleSettingsListing.Name = "ModuleSettingsListing"
  165. ModuleSettingsListing.Parent = ModuleSettings
  166. ModuleSettingsListing.HorizontalAlignment = Enum.HorizontalAlignment.Center
  167. ModuleSettingsListing.SortOrder = Enum.SortOrder.LayoutOrder
  168.  
  169. local tog = false
  170. local ToggleState = false
  171.  
  172. ModuleButton.MouseButton2Click:Connect(function()
  173. tog = not tog
  174. if tog then
  175. ModuleSettings.Visible = true
  176. else
  177. ModuleSettings.Visible = false
  178. end
  179. end)
  180.  
  181. local function SetState(State)
  182. if State then
  183. game.TweenService:Create(ModuleButton, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  184. TextColor3 = Color3.fromRGB(42, 123, 155)
  185. }):Play()
  186. elseif not State then
  187. game.TweenService:Create(ModuleButton, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  188. TextColor3 = Color3.fromRGB(255, 255, 255)
  189. }):Play()
  190. end
  191. ToggleState = State
  192. callback(State)
  193. end
  194.  
  195. ModuleButton.MouseButton1Click:Connect(function()
  196. ToggleState = not ToggleState
  197. SetState(ToggleState)
  198. end)
  199.  
  200. if default == nil then
  201. function ToggleInit:SetState(State)
  202. SetState(State)
  203. end
  204. else
  205. SetState(DefaultLocal)
  206. end
  207.  
  208. function ToggleInit:GetState(State)
  209. return ToggleState
  210. end
  211.  
  212. function ModuleHandler:NewLabel(Name)
  213.  
  214. local Label = Instance.new("TextLabel")
  215.  
  216. Label.Name = "Label"
  217. Label.Parent = ModuleSettings
  218. Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  219. Label.BackgroundTransparency = 1.000
  220. Label.Size = UDim2.new(1, 0, 0, 30)
  221. Label.Font = Enum.Font.Nunito
  222. Label.FontFace = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Bold)
  223. Label.Text = Name:upper()
  224. Label.TextColor3 = Color3.fromRGB(90, 90, 90)
  225. Label.TextSize = 19.000
  226. end
  227.  
  228. function ModuleHandler:NewToggle(Name, default, callback)
  229.  
  230. local tog = default or false
  231.  
  232. local ToggleButton = Instance.new("TextButton")
  233. local ToggleButtonPadding = Instance.new("UIPadding")
  234. local Toggle = Instance.new("Frame")
  235. local ToggleCorner = Instance.new("UICorner")
  236.  
  237. ToggleButton.Name = "ToggleButton"
  238. ToggleButton.Parent = ModuleSettings
  239. ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  240. ToggleButton.BackgroundTransparency = 1.000
  241. ToggleButton.BorderSizePixel = 0
  242. ToggleButton.Size = UDim2.new(1, 0, 0, 30)
  243. ToggleButton.Font = Enum.Font.Nunito
  244. ToggleButton.Text = Name
  245. ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  246. ToggleButton.TextSize = 19.000
  247. ToggleButton.TextXAlignment = Enum.TextXAlignment.Left
  248.  
  249. ToggleButtonPadding.Name = "ToggleButtonPadding"
  250. ToggleButtonPadding.Parent = ToggleButton
  251. ToggleButtonPadding.PaddingLeft = UDim.new(0, 10)
  252.  
  253. Toggle.Name = "Toggle"
  254. Toggle.Parent = ToggleButton
  255. Toggle.Position = UDim2.new(0.800000012, 0, 0.200000003, 0)
  256. Toggle.BackgroundColor3 = tog and Color3.fromRGB(42, 123, 155) or Color3.fromRGB(37, 37, 37)
  257. Toggle.Size = UDim2.new(0, 18, 0, 18)
  258.  
  259. ToggleCorner.CornerRadius = UDim.new(0, 3)
  260. ToggleCorner.Name = "ToggleCorner"
  261. ToggleCorner.Parent = Toggle
  262.  
  263. ToggleButton.MouseButton1Click:Connect(function()
  264. tog = not tog
  265. callback(tog)
  266. if tog then
  267. game.TweenService:Create(Toggle, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  268. BackgroundColor3 = Color3.fromRGB(42, 123, 155)
  269. }):Play()
  270. else
  271. game.TweenService:Create(Toggle, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  272. BackgroundColor3 = Color3.fromRGB(37, 37, 37)
  273. }):Play()
  274. end
  275. end)
  276. end
  277.  
  278. function ModuleHandler:NewSlider(Name, minvalue, maxvalue, default, callback)
  279.  
  280. minvalue = minvalue or 0
  281. maxvalue = maxvalue or 100
  282.  
  283. callback = callback or function() end
  284.  
  285. local Slider = Instance.new("TextLabel")
  286. local SliderPadding = Instance.new("UIPadding")
  287. local SliderValue = Instance.new("TextBox")
  288. local SliderValueCorner = Instance.new("UICorner")
  289.  
  290. Slider.Name = "Slider"
  291. Slider.Parent = ModuleSettings
  292. Slider.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  293. Slider.BackgroundTransparency = 1.000
  294. Slider.Size = UDim2.new(1, 0, 0, 30)
  295. Slider.Font = Enum.Font.Nunito
  296. Slider.Text = Name
  297. Slider.TextColor3 = Color3.fromRGB(255, 255, 255)
  298. Slider.TextSize = 19.000
  299. Slider.TextXAlignment = Enum.TextXAlignment.Left
  300.  
  301. SliderPadding.Name = "SliderPadding"
  302. SliderPadding.Parent = Slider
  303. SliderPadding.PaddingLeft = UDim.new(0, 10)
  304.  
  305. SliderValue.Name = "SliderValue"
  306. SliderValue.Parent = Slider
  307. SliderValue.AnchorPoint = Vector2.new(1, 0)
  308. SliderValue.BackgroundColor3 = Color3.fromRGB(37, 37, 37)
  309. SliderValue.Position = UDim2.new(0.930000007, 0, 0.200000003, 0)
  310. SliderValue.Size = UDim2.new(0, 18, 0, 18)
  311. SliderValue.Font = Enum.Font.Nunito
  312. SliderValue.Text = default
  313. SliderValue.TextColor3 = Color3.fromRGB(255, 255, 255)
  314. SliderValue.TextSize = 19.000
  315. SliderValue.AutomaticSize = Enum.AutomaticSize.X
  316.  
  317. SliderValueCorner.CornerRadius = UDim.new(0, 3)
  318. SliderValueCorner.Name = "SliderValueCorner"
  319. SliderValueCorner.Parent = SliderValue
  320.  
  321. SliderValue:GetPropertyChangedSignal("Text"):Connect(function()
  322. SliderValue.Text = SliderValue.Text:gsub('%D+', '')
  323. pcall(function()
  324. callback(SliderValue.Text)
  325. end)
  326. end)
  327.  
  328. function ModuleHandler:NewKeybind(Bind, callback)
  329.  
  330. local KeybindInit = {}
  331. Bind = Bind or "NONE"
  332.  
  333. local WaitingForBind = false
  334. local Selected = Bind
  335. local Blacklist = {"W","A","S","D","Slash","Tab","Backspace","Escape","Space","Delete","Unknown","Backquote","Insert"}
  336.  
  337. local KeybindText = Instance.new("TextLabel")
  338. local KeybindTextPadding = Instance.new("UIPadding")
  339. local Keybind = Instance.new("TextButton")
  340. local KeybindCorner = Instance.new("UICorner")
  341.  
  342. KeybindText.Name = "KeybindText"
  343. KeybindText.Parent = ModuleSettings
  344. KeybindText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  345. KeybindText.BackgroundTransparency = 1.000
  346. KeybindText.Size = UDim2.new(1, 0, 0, 30)
  347. KeybindText.Font = Enum.Font.Nunito
  348. KeybindText.Text = "Keybind"
  349. KeybindText.TextColor3 = Color3.fromRGB(255, 255, 255)
  350. KeybindText.TextSize = 19.000
  351. KeybindText.TextXAlignment = Enum.TextXAlignment.Left
  352.  
  353. KeybindTextPadding.Name = "KeybindTextPadding"
  354. KeybindTextPadding.Parent = KeybindText
  355. KeybindTextPadding.PaddingLeft = UDim.new(0, 10)
  356.  
  357. Keybind.Name = "Keybind"
  358. Keybind.Parent = KeybindText
  359. Keybind.AnchorPoint = Vector2.new(1, 0)
  360. Keybind.BackgroundColor3 = Color3.fromRGB(37, 37, 37)
  361. Keybind.BorderSizePixel = 0
  362. Keybind.Position = UDim2.new(0.930000007, 0, 0.200000003, 0)
  363. Keybind.Size = UDim2.new(0, 18, 0, 18)
  364. Keybind.Font = Enum.Font.Nunito
  365. Keybind.Text = Bind
  366. Keybind.TextColor3 = Color3.fromRGB(255, 255, 255)
  367. Keybind.TextSize = 19.000
  368. Keybind.AutomaticSize = Enum.AutomaticSize.X
  369.  
  370. KeybindCorner.CornerRadius = UDim.new(0, 3)
  371. KeybindCorner.Name = "KeybindCorner"
  372. KeybindCorner.Parent = Keybind
  373.  
  374. Keybind.Visible = true
  375. Keybind.Text = Bind
  376.  
  377. Keybind.MouseButton1Click:Connect(function()
  378. Keybind.Text = "..."
  379. WaitingForBind = true
  380. end)
  381.  
  382. UserInputService.InputBegan:Connect(function(Input)
  383. if WaitingForBind and Input.UserInputType == Enum.UserInputType.Keyboard then
  384. local Key = tostring(Input.KeyCode):gsub("Enum.KeyCode.", "")
  385. if not table.find(Blacklist, Key) then
  386. Keybind.Text = Key
  387. Selected = Key
  388. else
  389. Keybind.Text = "NONE"
  390. Selected = "NONE"
  391. end
  392. WaitingForBind = false
  393. elseif Input.UserInputType == Enum.UserInputType.Keyboard then
  394. local Key = tostring(Input.KeyCode):gsub("Enum.KeyCode.", "")
  395. if Key == Selected then
  396. ToggleState = not ToggleState
  397. SetState(ToggleState)
  398. if callback then
  399. callback(Key)
  400. end
  401. end
  402. end
  403. end)
  404.  
  405. function KeybindInit:SetBind(Key)
  406. Keybind.Text = Key
  407. Selected = Key
  408. end
  409.  
  410. function KeybindInit:GetBind()
  411. return Selected
  412. end
  413. end
  414. end
  415. return ModuleSettings
  416. end
  417. return ModuleHandler
  418. end
  419. return CategoryHandler
  420. end
  421. return Library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement