Advertisement
DeltaTechnology

Untitled

Sep 28th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.85 KB | None | 0 0
  1. local sGui = Instance.new("ScreenGui")
  2. sGui.Parent = game.CoreGui
  3. sGui.ZIndexBehavior = Enum.ZIndexBehavior.Global
  4. sGui.Name = math.random(1, 99999999)
  5. local uis = game:GetService("UserInputService")
  6. local lib = {
  7. windows = 0;
  8. }
  9. local Mouse = game.Players.LocalPlayer:GetMouse()
  10.  
  11. lib.Options = {
  12. TextColor = Color3.fromRGB(255,255,255),
  13. Color1 = Color3.fromRGB(40,40,40),
  14. togON = Color3.fromRGB(47, 211, 47),
  15. togOFF = Color3.fromRGB(211, 47, 47);
  16. }
  17.  
  18. local function getNextWindowPos()
  19. local biggest = 0;
  20. local ok = nil;
  21. for i,v in pairs(sGui:GetChildren()) do
  22. if v.Position.X.Offset>biggest then
  23. biggest = v.Position.X.Offset
  24. ok = v;
  25. end
  26. end
  27. if biggest == 0 then
  28. biggest = biggest + 5;
  29. else
  30. biggest = biggest + ok.Size.X.Offset + 5;
  31. end
  32.  
  33. return biggest;
  34. end
  35.  
  36. function lib:CreateWindow(title)
  37. lib.windows = lib.windows + 1;
  38. local Top = Instance.new("Frame", sGui)
  39. local Body = Instance.new("Frame")
  40. local Title = Instance.new("TextLabel")
  41. local Hide = Instance.new("ImageButton")
  42. local layout = Instance.new("UIListLayout", Body)
  43. local padding = Instance.new("UIPadding", Body)
  44. layout.Padding = UDim.new(0, 5)
  45. padding.PaddingLeft = UDim.new(0, 5)
  46. padding.PaddingRight = UDim.new(0, 5)
  47. padding.PaddingTop = UDim.new(0, 5)
  48. local instances = 0;
  49. local dragging = false;
  50. Top.Name = title
  51. Top.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  52. Top.BorderSizePixel = 0
  53. Top.Active = true
  54. Top.Size = UDim2.new(0, 175, 0, 35)
  55. Top.Position = UDim2.new(0, getNextWindowPos() + 10, 0, 10)
  56. local dragging
  57. local dragInput
  58. local dragStart
  59. local startPos
  60. local function update(input)
  61. local delta = input.Position - dragStart
  62. Top:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y), "Out", "Sine", 0.05, true)
  63. end
  64. Top.InputBegan:Connect(function(input)
  65. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  66. dragging = true
  67. dragStart = input.Position
  68. startPos = Top.Position
  69.  
  70. input.Changed:Connect(function()
  71. if input.UserInputState == Enum.UserInputState.End then
  72. dragging = false
  73. end
  74. end)
  75. end
  76. end)
  77. Top.InputChanged:Connect(function(input)
  78. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  79. dragInput = input
  80. end
  81. end)
  82. uis.InputChanged:Connect(function(input)
  83. if input == dragInput and dragging then
  84. update(input)
  85. end
  86. end)
  87. Body.Name = "Body"
  88. Body.Parent = Top
  89. Body.BackgroundColor3 = Color3.fromRGB(23, 23, 23)
  90. Body.BorderSizePixel = 0
  91. Body.Position = UDim2.new(0, 0, 1, 0)
  92. Body.ClipsDescendants = false
  93. Body.Size = UDim2.new(1, 0, 0, 5)
  94.  
  95. Title.Name = "Title"
  96. Title.Parent = Top
  97. Title.BackgroundTransparency = 1
  98. Title.Position = UDim2.new(0, 0, 0, 0)
  99. Title.Size = UDim2.new(1, 0, 1, 0)
  100. Title.Font = "GothamSemibold"
  101. Title.Text = title or "new window"
  102. Title.TextSize = 18
  103. Title.TextColor3 = lib.Options.TextColor
  104.  
  105. Hide.Name = "Hide"
  106. Hide.Parent = Top
  107. Hide.BackgroundTransparency = 1
  108. Hide.Size = UDim2.new(0, 20, 0, 20)
  109. Hide.Position = UDim2.new(1, -25, 0.5, -10)
  110. Hide.Image = "rbxassetid://4726772330"
  111. Hide.Rotation = 90
  112. Body.ClipsDescendants = true
  113. local pp;
  114. --local origsize;
  115. local open = true;
  116. Hide.MouseButton1Click:Connect(function()
  117. open = not open
  118. local a = game:GetService("TweenService"):Create(Hide, TweenInfo.new(0.2), {Rotation = (open and 90 or 0)})
  119. a:Play()
  120. local y = 0;
  121. for i, v in next, Body:GetChildren() do
  122. if (not v:IsA('UIListLayout')) and (not v:IsA("UIPadding")) then
  123. y = y + v.AbsoluteSize.Y;
  124. end
  125. end
  126. Body:TweenSize(open and UDim2.new(1, 0, 0, y+(5 * instances)+5) or UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.2, true)
  127. end)
  128. local aaa = {}
  129.  
  130. function aaa:Size()
  131. local y = 0;
  132. for i, v in next, Body:GetChildren() do
  133. if (not v:IsA('UIListLayout')) and(not v:IsA("UIPadding")) then
  134. y = y + v.AbsoluteSize.Y;
  135. end
  136. end
  137. Body.Size = UDim2.new(1, 0, 0, y+(5 * instances)+5)
  138. pp = y;
  139. end
  140.  
  141. function aaa:AddButton(title, callback)
  142. local Button = Instance.new("TextButton")
  143. Button.Name = "Button"
  144. Button.BackgroundTransparency = 1
  145. Button.Size = UDim2.new(1, 0, 0, 35)
  146. Button.ZIndex = 3
  147. Button.Font = "GothamSemibold"
  148. Button.Text = title
  149. Button.Parent = Body
  150. Button.TextSize = 14
  151. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  152. instances = instances + 1
  153. local a = Instance.new("ImageLabel", Button)
  154. a.Position = UDim2.new(0.5, 0, 0.5, 0)
  155. a.Image = "rbxassetid://3570695787"
  156. a.Size = UDim2.new(1, 0, 1, 0)
  157. a.ZIndex = 1
  158. a.AnchorPoint = Vector2.new(0.5, 0.5)
  159. a.BackgroundTransparency = 1
  160. a.ImageTransparency = 0
  161. a.ImageColor3 = lib.Options.Color1
  162. a.ScaleType = "Slice"
  163. a.ClipsDescendants = true
  164. a.SliceCenter = Rect.new(100, 100, 100, 100)
  165. a.SliceScale = 0.05
  166. callback = callback or function() end
  167. self:Size()
  168. Button.MouseButton1Click:Connect(callback)
  169.  
  170. Button.MouseEnter:Connect(function()
  171. a.ImageTransparency = 0.1;
  172. end)
  173. Button.MouseLeave:Connect(function()
  174. a.ImageTransparency = 0;
  175. end)
  176. Button.MouseButton1Down:Connect(function()
  177. --[[a.ImageTransparency = 0.3
  178. wait()
  179. a.ImageTransparency = 0]]
  180. local c = Instance.new("ImageLabel", a)
  181. c.BackgroundTransparency = 1
  182. c.Image = "rbxassetid://3570695787"
  183. c.ImageTransparency = 0.6
  184. c.Position = UDim2.new(0, (Mouse.X - c.AbsolutePosition.X), 0, (Mouse.Y - c.AbsolutePosition.Y))
  185. c.ScaleType = "Slice"
  186. c.SliceCenter = Rect.new(100, 100, 100, 100)
  187. c.SliceScale = 1
  188. local Size = 0
  189. if a.AbsoluteSize.X > a.AbsoluteSize.Y then
  190. Size = a.AbsoluteSize.X*1.5
  191. elseif a.AbsoluteSize.X < a.AbsoluteSize.Y then
  192. Size = a.AbsoluteSize.Y*1.5
  193. elseif a.AbsoluteSize.X == a.AbsoluteSize.Y then
  194. Size = a.AbsoluteSize.X*1.5
  195. end
  196. c:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(.5, -Size/2, .5, -Size/2), "Out", "Linear", .5)
  197. Button.MouseButton1Up:Connect(function()
  198. while c.ImageTransparency ~= 1 do
  199. wait()
  200. c.ImageTransparency = c.ImageTransparency + 0.02
  201. if c.ImageTransparency == 1 then c:Destroy() end
  202. end
  203. end)
  204. end)
  205. end
  206.  
  207. function aaa:AddToggle(title, callback)
  208. local label = Instance.new("TextLabel")
  209. label.Size = UDim2.new(1, 0, 0, 35)
  210. label.BackgroundTransparency = 1
  211. label.TextColor3 = lib.Options.TextColor
  212. label.TextSize = 14
  213. label.Font = "GothamSemibold"
  214. label.Parent = Body
  215. label.TextXAlignment = "Left"
  216. label.Text = title
  217. instances = instances + 1
  218. local Button = Instance.new("TextButton")
  219. Button.Name = "Button"
  220. Button.BackgroundTransparency = 1
  221. Button.Size = UDim2.new(0, 25, 0, 25)
  222. Button.ZIndex = 3
  223. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  224. Button.Position = UDim2.new(1, -25, 0.5, -13)
  225. Button.Text = ""
  226. Button.TextSize = 24
  227. Button.Font = "Garamond"
  228. Button.TextYAlignment = "Bottom"
  229. Button.TextTransparency = 0
  230. Button.Parent = label
  231. local a = Instance.new("ImageLabel", Button)
  232. a.Position = UDim2.new(0.5, 0, 0.5, 0)
  233. a.Image = "rbxassetid://3570695787"
  234. a.Size = UDim2.new(1, 0, 1, 0)
  235. a.ZIndex = 1
  236. a.AnchorPoint = Vector2.new(0.5, 0.5)
  237. a.BackgroundTransparency = 1
  238. a.ImageTransparency = 0
  239. a.ClipsDescendants = true
  240. a.ImageColor3 = lib.Options.Color1
  241. a.ScaleType = "Slice"
  242. a.SliceCenter = Rect.new(100, 100, 100, 100)
  243. a.SliceScale = 0.05
  244. a.ImageColor3 = lib.Options.Color1
  245. callback = callback or function() end
  246. self:Size()
  247. local tog = false;
  248. Button.MouseButton1Click:Connect(function()
  249. tog = not tog;
  250. callback(tog)
  251. Button.Text = (tog and utf8.char(10005) or "")
  252. --a.ImageColor3 = (tog and lib.Options.togON or lib.Options.togOFF)
  253. --[[local b = game:GetService("TweenService"):Create(a, TweenInfo.new(0.2), {ImageColor3 = (tog and lib.Options.togON or lib.Options.togOFF)})
  254. local c = game:GetService("TweenService"):Create(Button, TweenInfo.new(0.2), {TextTransparency = (tog and 0 or 1)})
  255. c:Play()
  256. b:Play()]]--
  257. end)
  258.  
  259. Button.MouseEnter:Connect(function()
  260. a.ImageTransparency = 0.1;
  261. end)
  262. Button.MouseLeave:Connect(function()
  263. a.ImageTransparency = 0;
  264. end)
  265. end
  266.  
  267. function aaa:AddSlider(title, min, max, startPoint, callback)
  268. instances = instances + 1
  269. local dragging = false;
  270. local label = Instance.new("TextLabel")
  271. local sliderFrame = Instance.new("ImageLabel")
  272. local slidingFrame = Instance.new("ImageLabel")
  273. label.BackgroundTransparency = 1
  274. label.Size = UDim2.new(1, 0, 0, 35)
  275. label.BackgroundTransparency = 1
  276. label.TextColor3 = lib.Options.TextColor
  277. label.TextSize = 14
  278. label.Font = "GothamSemibold"
  279. label.Parent = Body
  280. label.TextXAlignment = "Left"
  281. label.Text = title
  282. sliderFrame.Name = "sliderFrame"
  283. sliderFrame.Parent = label
  284. sliderFrame.BackgroundTransparency = 1
  285. sliderFrame.Position = UDim2.new(1, -80, 0.5, -3)
  286. sliderFrame.Size = UDim2.new(0, 80, 0, 6)
  287. sliderFrame.Image = "rbxassetid://3570695787"
  288. sliderFrame.ImageColor3 = Color3.fromRGB(75, 75, 75)
  289. sliderFrame.ScaleType = "Slice"
  290. sliderFrame.SliceCenter = Rect.new(100, 100, 100, 100)
  291. slidingFrame.Name = "slidingFrame"
  292. slidingFrame.Parent = sliderFrame
  293. slidingFrame.BackgroundTransparency = 1
  294. slidingFrame.Position = UDim2.new((startPoint or 0)/max, -6, 0.5, -5)
  295. slidingFrame.Size = UDim2.new(0, 10, 0, 10)
  296. slidingFrame.Image = "rbxassetid://3570695787"
  297. slidingFrame.ScaleType = "Slice"
  298. slidingFrame.SliceCenter = Rect.new(100, 100, 100, 100)
  299. slidingFrame.ImageColor3 = Color3.fromRGB(255, 255, 255)
  300. local val = Instance.new("TextLabel", sliderFrame)
  301. val.BackgroundTransparency = 1
  302. val.Position = UDim2.new(0, 0, 1, 1)
  303. val.Size = UDim2.new(1, 0, 0, 10)
  304. val.Font = "GothamSemibold"
  305. val.TextColor3 = Color3.new(1, 1, 1)
  306. val.TextScaled = true
  307. val.TextTransparency = 1
  308. val.Text = tostring(startPoint and math.floor((startPoint / max) * (max - min) + min) or 0).."/"..tostring(max)
  309. self:Size()
  310. -- Dragging Function --
  311. local function move(input)
  312. local pos = UDim2.new(math.clamp((input.Position.X - sliderFrame.AbsolutePosition.X) / sliderFrame.AbsoluteSize.X, 0, 1), -6, 0.5, -5)
  313. slidingFrame:TweenPosition(pos, "Out", "Sine", 0.1, true);
  314. local value = math.floor(((pos.X.Scale * max) / max) * (max - min) + min)
  315. val.Text = tostring(value).."/"..tostring(max);
  316. callback(value)
  317. end
  318. slidingFrame.InputBegan:Connect(function(input)
  319. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  320. dragging = true;
  321. local b = game:GetService("TweenService"):Create(val, TweenInfo.new(0.2), {TextTransparency = 0})
  322. b:Play()
  323. end
  324. end)
  325. slidingFrame.InputEnded:Connect(function(input)
  326. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  327. dragging = false;
  328. wait(1)
  329. local b = game:GetService("TweenService"):Create(val, TweenInfo.new(0.2), {TextTransparency = 1})
  330. b:Play()
  331. end
  332. end)
  333. game:GetService("UserInputService").InputChanged:Connect(function(input)
  334. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  335. move(input)
  336. end
  337. end)
  338. -----------------------
  339. end
  340. return aaa
  341. end
  342. return lib;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement