Advertisement
Dodikman

PJJ GUI

Jul 10th, 2019
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.97 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2.  
  3. function applyOptions(object, options)
  4. for k, v in pairs(options) do
  5. object[k] = v
  6. end
  7. return object
  8. end
  9. function decorateButton(button)
  10. button.MouseEnter:Connect(function()
  11. button.BackgroundColor3 = Color3.new(0, 5, 5)
  12. end)
  13. button.MouseLeave:Connect(function()
  14. button.BackgroundColor3 = Color3.new(0, 0, 0)
  15. end)
  16. end
  17.  
  18. local frameOptions = {
  19. ['Position'] = UDim2.new(0.13, 0, 0.4, 0),
  20. ['Style'] = Enum.FrameStyle.DropShadow
  21. }
  22.  
  23. local textButtonOptions = {
  24. ['BackgroundColor3'] = Color3.new(0, 0, 0),
  25. ['BackgroundTransparency'] = 0.5,
  26. ['TextColor3'] = Color3.new(0, 20, 20),
  27. ['TextScaled'] = true
  28. }
  29.  
  30. local gui = Instance.new('ScreenGui')
  31. gui.Parent = plr.PlayerGui
  32. gui.ResetOnSpawn = false
  33.  
  34. local memory = {}
  35.  
  36. --FUNCTIONS
  37. local speeds = {16, 24, 36, 48, 60, 72}
  38. local currentSpeed = 1
  39. function speedHack()
  40. local button = memory['speedHack']
  41. if game.Workspace:FindFirstChild(plr.Name) then
  42. local hum = plr.Character.Humanoid
  43. currentSpeed = currentSpeed + 1
  44. if currentSpeed > #speeds then
  45. currentSpeed = 1
  46. end
  47. hum.WalkSpeed = speeds[currentSpeed]
  48. button.Text = 'SpeedHack: ' .. speeds[currentSpeed]
  49. if currentSpeed == 1 then
  50. button.Text = 'SpeedHack: OFF'
  51. end
  52. hum:GetPropertyChangedSignal('WalkSpeed'):Connect(function()
  53. hum.WalkSpeed = speeds[currentSpeed]
  54. end)
  55. plr.CharacterAdded:Connect(function(char)
  56. char:WaitForChild('Humanoid').WalkSpeed = speeds[currentSpeed]
  57. end)
  58. end
  59. end
  60.  
  61. local powers = {50, 75, 100, 125, 150, 175}
  62. local currentPower = 1
  63. function jumpHack()
  64. local button = memory['jumpHack']
  65. if game.Workspace:FindFirstChild(plr.Name) then
  66. local hum = plr.Character.Humanoid
  67. currentPower = currentPower + 1
  68. if currentPower > #powers then
  69. currentPower = 1
  70. end
  71. hum.JumpPower = powers[currentPower]
  72. button.Text = 'JumpHack: ' .. powers[currentPower]
  73. if currentPower == 1 then
  74. button.Text = 'JumpHack: OFF'
  75. end
  76. hum:GetPropertyChangedSignal('JumpPower'):Connect(function()
  77. hum.JumpPower = powers[currentPower]
  78. end)
  79. plr.CharacterAdded:Connect(function(char)
  80. char:WaitForChild('Humanoid').JumpPower = powers[currentPower]
  81. end)
  82. end
  83. end
  84.  
  85. function tpAllTools()
  86. if game.Workspace:FindFirstChild(plr.Name) then
  87. local char = plr.Character
  88. local startPos = char.HumanoidRootPart.Position
  89. for k, v in pairs(game.Workspace:GetChildren()) do
  90. if v.ClassName == 'Tool' and v:FindFirstChild('Handle') then
  91. char:MoveTo(v.Handle.Position)
  92. wait(0.25)
  93. end
  94. end
  95. char:MoveTo(startPos)
  96. end
  97. end
  98.  
  99. local blacklist = {['Shop'] = 1, ['bigmeter'] = 1}
  100. function checkForTools()
  101. local frame = memory['checkForTools'].Parent
  102. local shiftX = 0
  103. local shiftY = 0.14
  104. for k, v in pairs(frame:GetChildren()) do
  105. if v.Name == 'Tool' then
  106. v:Remove()
  107. end
  108. end
  109. for k, v in pairs(game.Workspace:GetChildren()) do
  110. if (blacklist[v.Name] ~= 1) and ((v.ClassName == 'Tool' and v:FindFirstChild('Handle')) or (v.ClassName == 'Part' and v:FindFirstChild('Handler') and v:FindFirstChild('ClickDetector'))) then
  111. local button = Instance.new('TextButton')
  112. button.Parent = frame
  113. button.Position = UDim2.new(shiftX, 0, shiftY, 0)
  114. button.Size = UDim2.new(0.1, 0, 0.1, 0)
  115. button.Text = v.Name
  116. button.Name = 'Tool'
  117. applyOptions(button, textButtonOptions)
  118. decorateButton(button)
  119.  
  120. button.MouseButton1Click:Connect(function()
  121. if game.Workspace:FindFirstChild(plr.Name) then
  122. local char = plr.Character
  123. local startPosition = char.HumanoidRootPart.Position
  124. if v.ClassName == 'Tool' then
  125. char:MoveTo(v.Handle.Position)
  126. wait(0.5)
  127. char:MoveTo(startPosition)
  128. else
  129. char:MoveTo(v.Position)
  130. end
  131. end
  132. end)
  133.  
  134. game.Workspace.ChildRemoved:Connect(function(child)
  135. if child == v then
  136. button:Remove()
  137. end
  138. end)
  139. shiftX = shiftX + button.Size.X.Scale
  140. if shiftX > 0.5 then
  141. shiftX = 0
  142. shiftY = shiftY + 0.11
  143. end
  144. end
  145. end
  146. end
  147. --FUNCTIONS
  148.  
  149. local frames = {
  150. ['ExplorerFrame'] = {
  151. ['options'] = {
  152. ['Size'] = UDim2.new(1, 0, 0.4, 0)
  153. },
  154. ['objects'] = {
  155. ['tpAllTools'] = {
  156. ['type'] = 'TextButton',
  157. ['options'] = textButtonOptions,
  158. ['additionalOptions'] = {
  159. ['Size'] = UDim2.new(0.125, 0, 0.125, 0),
  160. ['Text'] = 'Teleport All Tools'
  161. },
  162. ['function'] = tpAllTools
  163. },
  164. ['checkForTools'] = {
  165. ['type'] = 'TextButton',
  166. ['options'] = textButtonOptions,
  167. ['additionalOptions'] = {
  168. ['Position'] = UDim2.new(0.13, 0, 0, 0),
  169. ['Size'] = UDim2.new(0.125, 0, 0.125, 0),
  170. ['Text'] = 'Check For Tools'
  171. },
  172. ['function'] = checkForTools
  173. },
  174. }
  175. },
  176. ['TeleportsFrame'] = {
  177. ['options'] = {
  178. ['Size'] = UDim2.new(0.5, 0, 0.4, 0)
  179. },
  180. ['objects'] = {
  181.  
  182. }
  183. },
  184. ['MiscFrame'] = {
  185. ['options'] = {
  186. ['Size'] = UDim2.new(0.25, 0, 0.4, 0)
  187. },
  188. ['objects'] = {
  189. ['speedHack'] = {
  190. ['type'] = 'TextButton',
  191. ['options'] = textButtonOptions,
  192. ['additionalOptions'] = {
  193. ['Size'] = UDim2.new(1, 0, 0.125, 0),
  194. ['Text'] = 'SpeedHack: OFF'
  195. },
  196. ['function'] = speedHack
  197. },
  198. ['jumpHack'] = {
  199. ['type'] = 'TextButton',
  200. ['options'] = textButtonOptions,
  201. ['additionalOptions'] = {
  202. ['Position'] = UDim2.new(0, 0, 0.125, 0),
  203. ['Size'] = UDim2.new(1, 0, 0.125, 0),
  204. ['Text'] = 'JumpHack: OFF'
  205. },
  206. ['function'] = jumpHack
  207. }
  208. }
  209. }
  210. }
  211.  
  212. local opening = false
  213. local currentFrame = nil
  214.  
  215. local start = UDim2.new(0, 0, 0.4, 0)
  216. local standardSize = UDim2.new(0.125, 0, 0.05, 0)
  217. local shift = 0
  218. for k, v in pairs(frames) do
  219. local frame = applyOptions(Instance.new('Frame'), frameOptions)
  220. frame.Parent = gui
  221.  
  222. applyOptions(frame, v['options'])
  223. for l, b in pairs(v['objects']) do
  224. local object = Instance.new(b['type'])
  225. object.Parent = frame
  226. applyOptions(object, b['options'])
  227. applyOptions(object, b['additionalOptions'])
  228. if object.ClassName == 'TextButton' then
  229. memory[l] = object
  230. object.MouseButton1Click:Connect(function()
  231. spawn(b['function'])
  232. end)
  233. decorateButton(object)
  234. end
  235. end
  236.  
  237. local size = frame.Size
  238. frame.Size = UDim2.new(0, 0, 0, 0)
  239.  
  240. local button = Instance.new('TextButton')
  241. button.Parent = gui
  242. button:TweenPosition(UDim2.new(0, 0, shift, 0) + start)
  243. button:TweenSize(standardSize)
  244. button.Text = string.sub(k, 1, string.find(k, 'Frame') - 1)
  245. applyOptions(button, textButtonOptions)
  246. decorateButton(button)
  247. shift = shift + standardSize.Y.Scale + 0.005
  248. button.MouseButton1Click:Connect(function()
  249. if opening == false then
  250. opening = true
  251. if currentFrame ~= nil then
  252. if currentFrame == frame then
  253. frame:TweenSize(UDim2.new(0, 0, 0, 0))
  254. currentFrame = nil
  255. else
  256. currentFrame:TweenSize(UDim2.new(0, 0, 0, 0))
  257. frame:TweenSize(size)
  258. currentFrame = frame
  259. end
  260. else
  261. frame:TweenSize(size)
  262. currentFrame = frame
  263. end
  264. wait(1)
  265. opening = false
  266. end
  267. end)
  268. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement