SkeletalScripts

Untitled

Apr 3rd, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.53 KB | None | 0 0
  1. local library = {}
  2.  
  3. local ScreenGui = Instance.new("ScreenGui")
  4. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  5. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  6. ScreenGui.ResetOnSpawn = false
  7.  
  8. function library:CreateWindow(name)
  9. wait(0.2)
  10. local pos = 0.1
  11. local get = ScreenGui:GetChildren()
  12. if ScreenGui:FindFirstChild("Container") ~= nil then -- checking if there is already a menu
  13. for i = 1, #get do
  14. pos = pos + 0.22
  15. end
  16. else
  17. pos = 0.1
  18. end
  19. local Main = Instance.new("Frame")
  20. local Title = Instance.new("TextLabel")
  21. local Container = Instance.new("Frame")
  22. local UIListLayout = Instance.new("UIListLayout")
  23. local Minimize = Instance.new("TextButton")
  24.  
  25. Main.Name = "Main"
  26. Main.Parent = ScreenGui
  27. Main.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  28. Main.BorderSizePixel = 0
  29. Main.Position = UDim2.new(0.109173618, 0, 0.0199714694, 0)
  30. Main.Size = UDim2.new(0, 150, 0, 30)
  31.  
  32. Title.Name = "Title"
  33. Title.Parent = Main
  34. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  35. Title.BackgroundTransparency = 1.000
  36. Title.Size = UDim2.new(1, 0, 0.75, 0)
  37. Title.Font = Enum.Font.SourceSans
  38. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  39. Title.TextScaled = true
  40. Title.TextSize = 14.000
  41. Title.TextWrapped = true
  42.  
  43. Container.Name = "Container"
  44. Container.Parent = Main
  45. Container.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  46. Container.BorderSizePixel = 0
  47. Container.ClipsDescendants = true
  48. Container.Position = UDim2.new(0, 0, 1, 0)
  49. Container.Size = UDim2.new(0, 150, 0, 135)
  50. Container.ClipsDescendants = true
  51.  
  52. UIListLayout.Parent = Container
  53. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  54. UIListLayout.Padding = UDim.new(0, 2)
  55.  
  56. Minimize.Name = "Minimize"
  57. Minimize.Parent = Main
  58. Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  59. Minimize.BackgroundTransparency = 1.000
  60. Minimize.Position = UDim2.new(0.800000012, 0, 0, 0)
  61. Minimize.Size = UDim2.new(0, 30, 0, 30)
  62. Minimize.Font = Enum.Font.SourceSans
  63. Minimize.Text = "-"
  64. Minimize.TextColor3 = Color3.fromRGB(206, 206, 206)
  65. Minimize.TextScaled = true
  66. Minimize.TextSize = 14.000
  67. Minimize.TextWrapped = true
  68. local old = UDim2.new(0,150,0,0)
  69. Minimize.MouseButton1Click:Connect(function()
  70. if Container.Size ~= UDim2.new(0,150,0,0) then
  71. old = Container.Size
  72. Container:TweenSize(UDim2.new(0,150,0,0),"In","Sine",0.45,false,nil)
  73. Minimize.Text = "+"
  74. else
  75. Container:TweenSize(old,"Out","Sine",0.45,false,nil)
  76. Minimize.Text = "-"
  77. end
  78.  
  79. local Window = {}
  80.  
  81. function Window:Button(name,callback)
  82. callback = callback or function() end
  83. local Button = Instance.new("TextButton")
  84.  
  85. Button.Name = "Button"
  86. Button.Parent = Container
  87. Button.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  88. Button.BorderSizePixel = 0
  89. Button.Size = UDim2.new(1, 0, 0, 30)
  90. Button.Font = Enum.Font.SourceSans
  91. Button.Text = " "..name
  92. Button.TextColor3 = Color3.fromRGB(206, 206, 206)
  93. Button.TextSize = 16.000
  94. Button.TextWrapped = true
  95. Button.TextXAlignment = Enum.TextXAlignment.Left
  96.  
  97. Button.MouseButton1Click:Connect(function()callback()end)
  98. end
  99.  
  100. function Window:Toggle(name,callback)
  101. local Toggle = Instance.new("TextLabel")
  102. local TextButton = Instance.new("TextButton")
  103.  
  104. Toggle.Name = "Toggle"
  105. Toggle.Parent = Container
  106. Toggle.Active = true
  107. Toggle.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  108. Toggle.BorderSizePixel = 0
  109. Toggle.Selectable = true
  110. Toggle.Size = UDim2.new(1, 0, 0, 30)
  111. Toggle.Font = Enum.Font.SourceSans
  112. Toggle.Text = " "..name
  113. Toggle.TextColor3 = Color3.fromRGB(206, 206, 206)
  114. Toggle.TextSize = 16.000
  115. Toggle.TextWrapped = true
  116. Toggle.TextXAlignment = Enum.TextXAlignment.Left
  117.  
  118. TextButton.Parent = Toggle
  119. TextButton.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  120. TextButton.BorderColor3 = Color3.fromRGB(180, 180, 180)
  121. TextButton.Position = UDim2.new(0.700000048, 0, 0.0333333351, 0)
  122. TextButton.Size = UDim2.new(0.266666681, 0, 0, 28)
  123. TextButton.Font = Enum.Font.SourceSans
  124. TextButton.Text = ""
  125. TextButton.TextColor3 = Color3.fromRGB(206, 206, 206)
  126. TextButton.TextScaled = true
  127. TextButton.TextSize = 14.000
  128. TextButton.TextWrapped = true
  129. TextButton.TextXAlignment = Enum.TextXAlignment.Left
  130. local tog =0
  131. TextButton.MouseButton1Click:Connect(function()
  132. if tog == 0 then
  133. tog = 1
  134. callback()
  135. else
  136. tog = 0
  137. end
  138. end)
  139. end
  140.  
  141. function Window:Box(name,callback)
  142. local Box = Instance.new("TextLabel")
  143. local TextButton_2 = Instance.new("TextBox")
  144.  
  145. Box.Name = "Box"
  146. Box.Parent = Container
  147. Box.Active = true
  148. Box.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  149. Box.BorderSizePixel = 0
  150. Box.Selectable = true
  151. Box.Size = UDim2.new(1, 0, 0, 30)
  152. Box.Font = Enum.Font.SourceSans
  153. Box.Text = " "..name
  154. Box.TextColor3 = Color3.fromRGB(206, 206, 206)
  155. Box.TextSize = 16.000
  156. Box.TextWrapped = true
  157. Box.TextXAlignment = Enum.TextXAlignment.Left
  158.  
  159. TextButton_2.Name = "TextButton"
  160. TextButton_2.Parent = Box
  161. TextButton_2.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  162. TextButton_2.BorderColor3 = Color3.fromRGB(180, 180, 180)
  163. TextButton_2.Position = UDim2.new(0.633333325, 0, 0.0333333351, 0)
  164. TextButton_2.Size = UDim2.new(0.333333373, 0, 0, 28)
  165. TextButton_2.Font = Enum.Font.SourceSans
  166. TextButton_2.Text = ""
  167. TextButton_2.TextColor3 = Color3.fromRGB(206, 206, 206)
  168. TextButton_2.TextScaled = true
  169. TextButton_2.TextSize = 14.000
  170. TextButton_2.TextWrapped = true
  171. TextButton_2.TextXAlignment = Enum.TextXAlignment.Left
  172.  
  173. TextButton_2.FocusLost:Connect(function()
  174. callback(TextButton_2.Text)
  175. end)
  176. end
  177. function Window:Slider(name,min,max,estimate,callback)
  178. min = min or 0
  179. max = max or 100
  180. estimate = estimate or true
  181. local Slider = Instance.new("TextLabel")
  182. local TextButton_3 = Instance.new("ImageButton")
  183. local TextButton_4 = Instance.new("ImageButton")
  184.  
  185. --Properties:
  186.  
  187. Slider.Name = "Slider"
  188. Slider.Parent = Container
  189. Slider.Active = true
  190. Slider.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  191. Slider.BorderSizePixel = 0
  192. Slider.Selectable = true
  193. Slider.Size = UDim2.new(1, 0, 0, 30)
  194. Slider.Font = Enum.Font.SourceSans
  195. Slider.Text = " "..name
  196. Slider.TextColor3 = Color3.fromRGB(206, 206, 206)
  197. Slider.TextSize = 16.000
  198. Slider.TextWrapped = true
  199. Slider.TextXAlignment = Enum.TextXAlignment.Left
  200.  
  201. TextButton_3.Name = "TextButton"
  202. TextButton_3.Parent = Slider
  203. TextButton_3.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  204. TextButton_3.BackgroundTransparency = 1.000
  205. TextButton_3.BorderColor3 = Color3.fromRGB(180, 180, 180)
  206. TextButton_3.BorderSizePixel = 0
  207. TextButton_3.Position = UDim2.new(0.533333361, 0, 0.0333333351, 0)
  208. TextButton_3.Size = UDim2.new(0.433333397, 0, 0, 28)
  209. TextButton_3.Image = "rbxassetid://3570695787"
  210. TextButton_3.ImageColor3 = Color3.fromRGB(58, 58, 58)
  211. TextButton_3.ScaleType = Enum.ScaleType.Slice
  212. TextButton_3.SliceCenter = Rect.new(100, 100, 100, 100)
  213. TextButton_3.SliceScale = 0.040
  214.  
  215. TextButton_4.Name = "TextButton"
  216. TextButton_4.Parent = TextButton_3
  217. TextButton_4.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
  218. TextButton_4.BorderColor3 = Color3.fromRGB(180, 180, 180)
  219. TextButton_4.BorderSizePixel = 0
  220. TextButton_4.Size = UDim2.new(0, 0, 1, 0)
  221. TextButton_4.Image = "rbxassetid://3570695787"
  222. TextButton_4.ImageTransparency = 0.900
  223. TextButton_4.ScaleType = Enum.ScaleType.Slice
  224. TextButton_4.SliceCenter = Rect.new(100, 100, 100, 100)
  225. TextButton_4.SliceScale = 0.040
  226.  
  227. local estimate = true
  228. local realVal = Slider.Text.." :"
  229. local Val = Slider
  230. local Sliderr = TextButton_3
  231. local mousepressed = false
  232. print(Sliderr)
  233. local SliderBtn = TextButton_4
  234. local Player = game:GetService("Players").LocalPlayer
  235. local UIS = game:GetService("UserInputService")
  236. local RuS = game:GetService("RunService")
  237. -- Properties
  238. local held = false
  239. local min = 0
  240. local max = 100
  241. local step = 0
  242. local percentage = 0
  243. function snap(number, factor)
  244. if factor == 0 then
  245. return number
  246. else
  247. return math.floor(number/factor+0.5)*factor
  248. end
  249. end
  250. UIS.InputEnded:connect(function(input, processed)
  251. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  252. held = false
  253. mousepressed = false
  254. end
  255. end)
  256. Sliderr.MouseButton1Down:Connect(function()
  257. mousepressed = true
  258. end)
  259. Sliderr.MouseEnter:connect(function()
  260. if mousepressed then
  261. held = true
  262. end
  263. end)
  264. RuS.RenderStepped:connect(function(delta)
  265. if held then
  266. local MousePos = UIS:GetMouseLocation().X
  267. local BtnPos = SliderBtn.Position
  268. local SliderSize = Slider.AbsoluteSize.X
  269. local SliderPos = Slider.AbsolutePosition.X
  270. local pos = snap((MousePos-SliderPos)/SliderSize,step)
  271. percentage = math.clamp(pos,0,1)
  272. SliderBtn.Position = UDim2.new(percentage/100,0,BtnPos.Y.Scale, BtnPos.Y.Offset)
  273. SliderBtn.Size = UDim2.new(percentage,0,1,0)
  274. local bry = (math.floor((0 + (max - 0) * percentage) * max) / max)
  275. if estimate == true then
  276.  
  277. local big = math.floor(bry)
  278. Val.Text = realVal..big..""
  279. elseif estimate == false then
  280. Val.Text = realVal..bry..""
  281. end
  282. end
  283. end)
  284. end
  285. return Window;
  286. end
  287. return library;
Advertisement
Add Comment
Please, Sign In to add comment