Advertisement
AlbertsHere

[Leak] Ozfinity Hub Scripts 3

Feb 18th, 2019
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.00 KB | None | 0 0
  1. The Gui is crap so i thought i just leak it.
  2. Hard Dragger
  3. Code:
  4. local player = game.Players.LocalPlayer
  5. local Character = player.Character or player.CharacterAdded:wait()
  6. local Humanoid = Character:WaitForChild("Humanoid")
  7. local walkSpeed = Humanoid.WalkSpeed
  8. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.Dragger.Disabled = true
  9. _G.dragRangeMin = 5
  10. fivefour = coroutine.wrap(function()
  11. EKey = false
  12. QKey = false
  13. player:GetMouse().KeyDown:connect(function(key)
  14. if string.lower(key) == "e" then
  15. EKey = true
  16. elseif string.lower(key) == "q" then
  17. QKey = true
  18. end
  19. end)
  20. player:GetMouse().KeyUp:connect(function(key)
  21. if string.lower(key) == "e" then
  22. EKey = false
  23. elseif string.lower(key) == "q" then
  24. QKey = false
  25. end
  26. end)
  27. while wait(0.1) do
  28. if EKey then
  29. F = FVal
  30. FVal = FVal + 1000
  31. ChangeForce(F+1000)
  32. print(F)
  33. end
  34. if QKey then
  35. F = FVal
  36. FVal = FVal - 1000
  37. ChangeForce(F-1000)
  38. print(F)
  39. end
  40. end
  41.  
  42. end)
  43. fivefour()
  44. local dragPart = Instance.new("Part",game.Players.LocalPlayer.PlayerGui)--game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.Dragger.Dragger
  45. dragPart.Size = Vector3.new(0.2,0.2,0.2)
  46. dragPart.BrickColor = BrickColor.new("Really red")
  47. player.CharacterAdded:connect(function()
  48. Character = player.Character
  49. Humanoid = Character:WaitForChild("Humanoid")
  50. Humanoid.Died:connect(function()
  51. dragPart.Parent = nil
  52. end)
  53. end)
  54.  
  55. wait(1)
  56. local dragRangeMax = 10000
  57. local dragRangeMin = _G.dragRangeMin
  58.  
  59. local camera = workspace.CurrentCamera
  60. local mouse = player:GetMouse()
  61.  
  62. local button1Down = false
  63. local dragRange = dragRangeMax
  64. FVal = 80000
  65. local bodyPosition = Instance.new("BodyPosition", dragPart)
  66. bodyPosition.maxForce = Vector3.new(1, 1, 1) * FVal
  67. bodyPosition.D = 1000
  68. bodyPosition.P = 4000
  69. function ChangeForce(F)
  70. if F > 0 then
  71. F = bodyPosition.maxForce.X+F
  72. bodyPosition.maxForce = Vector3.new(1, 1, 1) * F
  73. else
  74. F = bodyPosition.maxForce.X-F
  75. bodyPosition.maxForce = Vector3.new(1, 1, 1) * F
  76. end
  77. end
  78.  
  79. local bodyGyro = Instance.new("BodyGyro", dragPart)
  80. dragPart.Anchored = false
  81. dragPart:BreakJoints()
  82. bodyGyro.maxTorque = Vector3.new(1, 1, 1) * 200 --4000 -- * 0.000012
  83. bodyGyro.P = 1200
  84. bodyGyro.D = 140 --15
  85.  
  86. --bodyPosition.P = bodyPosition.P * 1/19
  87. --bodyPosition.D = bodyPosition.D * 1/19
  88. --bodyGyro.P = bodyGyro.P * 1/19
  89. --bodyGyro.D = bodyGyro.D * 1/19
  90.  
  91. local rotateCFrame = CFrame.new()
  92.  
  93. local weld = Instance.new("Weld", dragPart)
  94.  
  95. --local interactPermission = require(game.ReplicatedStorage.Interaction.InteractionPermission)
  96. local clientIsDragging = game.ReplicatedStorage.Interaction.ClientIsDragging
  97.  
  98. local carryAnimationTrack
  99.  
  100.  
  101. --------------------------------[[ Drag Main ]]------------------------------------
  102.  
  103. local draggingPart = false
  104.  
  105. function click()
  106. button1Down = true
  107.  
  108. local targetObject = game.Players.LocalPlayer:GetMouse().Target
  109. if not canDrag(targetObject) then
  110. return
  111. end
  112.  
  113. local mouseHit = game.Players.LocalPlayer:GetMouse().Hit.p
  114. if (mouseHit - Character.Head.Position).magnitude > dragRangeMax then
  115. return
  116. end
  117.  
  118. initializeDrag(targetObject, mouseHit)
  119. rotateCFrame = CFrame.new()
  120.  
  121. carryAnimationTrack:Play(0.1, 1, 1)
  122.  
  123. local dragIsFailing = 0
  124. local dragTime = 0
  125.  
  126.  
  127. while button1Down and canDrag(targetObject) do
  128. local desiredPos = Character.Head.Position + (game.Players.LocalPlayer:GetMouse().Hit.p - Character.Head.Position).unit * dragRange
  129.  
  130. local dragRay = Ray.new(Character.Head.Position, desiredPos - Character.Head.Position)
  131. local part, pos = workspace:FindPartOnRayWithIgnoreList(dragRay, {Character, dragPart, targetObject.Parent})
  132.  
  133. if part then
  134. desiredPos = pos
  135. end
  136.  
  137. if (camera.CoordinateFrame.p - Character.Head.Position).magnitude > 2 then
  138. desiredPos = desiredPos + Vector3.new(0, 1.8, 0)
  139. end
  140.  
  141. moveDrag(desiredPos)
  142. bodyGyro.cframe = CFrame.new(dragPart.Position, camera.CoordinateFrame.p) * rotateCFrame
  143.  
  144. local targParent = findHighestParent(targetObject) or targetObject
  145.  
  146. local attemptingToSurf = false
  147. for _, check in pairs({{Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.7, -2.8, 0)).p, Vector3.new(0, -2, 0))},
  148. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, 0)).p, Vector3.new(0, -2, 0))},
  149. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0, -2.8, 0)).p, Vector3.new(0, -2, 0))},
  150. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, 0)).p, Vector3.new(0, -2, 0))},
  151. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(-0.7, -2.8, 0)).p, Vector3.new(0, -2, 0))},
  152.  
  153. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, 0.6)).p, Vector3.new(0, -2, 0))},
  154. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0, -2.8, 0.6)).p, Vector3.new(0, -2, 0))},
  155. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, 0.6)).p, Vector3.new(0, -2, 0))},
  156.  
  157. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, -0.6)).p, Vector3.new(0, -2, 0))},
  158. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0, -2.8, -0.6)).p, Vector3.new(0, -2, 0))},
  159. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.35, -2.8, -0.6)).p, Vector3.new(0, -2, 0))},
  160.  
  161. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.5, -0.8, 0)).p, Character.HumanoidRootPart.CFrame.lookVector), State = Enum.HumanoidStateType.Climbing},
  162. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(-0.5, -0.8, 0)).p, Character.HumanoidRootPart.CFrame.lookVector), State = Enum.HumanoidStateType.Climbing},
  163. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(0.5, -1.3, 0)).p, Character.HumanoidRootPart.CFrame.lookVector), State = Enum.HumanoidStateType.Climbing},
  164. {Ray = Ray.new((Character.HumanoidRootPart.CFrame * CFrame.new(-0.5, -1.3, 0)).p, Character.HumanoidRootPart.CFrame.lookVector), State = Enum.HumanoidStateType.Climbing}
  165.  
  166. }) do
  167.  
  168. local ray = check.Ray
  169. local part, _ = workspace:FindPartOnRayWithIgnoreList(ray, {Character})
  170. local op = part
  171. part = part and findHighestParent(part)
  172.  
  173. if part and (not check.State or Humanoid:GetState() == check.State) then
  174. if part == targParent then
  175. attemptingToSurf = true
  176. else
  177. for _, connectedPart in pairs(op:GetConnectedParts(true)) do
  178.  
  179. if connectedPart == targetObject--[[targParent]] then
  180. attemptingToSurf = true
  181. break
  182. end
  183. end
  184. end
  185.  
  186. if attemptingToSurf then
  187. break
  188. end
  189. end
  190. end
  191.  
  192.  
  193.  
  194.  
  195.  
  196. local falling = Humanoid:GetState() == Enum.HumanoidStateType.Freefall or Humanoid:GetState() == Enum.HumanoidStateType.FallingDown--not part1 and not part2
  197.  
  198.  
  199. if attemptingToSurf then
  200. dragIsFailing = 0
  201. elseif falling then
  202. dragIsFailing = 0
  203. elseif (dragPart.Position - desiredPos).magnitude > 5 then
  204. dragIsFailing = 0
  205. else
  206. dragIsFailing = 0
  207. end
  208. if dragIsFailing > 16 then
  209. break
  210. end
  211.  
  212.  
  213. if dragTime % 10 == 0 and targParent.Parent:FindFirstChild("BedInfo") and targParent.Parent:FindFirstChild("Main") then
  214. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.Parent.Scripts.VehicleControl.SetVehicleOwnership:Fire(targParent.Parent.Main)
  215. end
  216.  
  217. clientIsDragging:FireServer(targParent.Parent)
  218.  
  219. wait()
  220. dragTime = 0
  221. end
  222.  
  223. carryAnimationTrack:Stop()
  224.  
  225. endDrag()
  226. end
  227.  
  228.  
  229. function findHighestParent(child)
  230. if not child or not child.Parent or child.Parent == workspace then
  231. return nil
  232. end
  233.  
  234. local ret = child.Parent:FindFirstChild("Owner") and child
  235. return findHighestParent(child.Parent) or ret
  236. end
  237.  
  238.  
  239.  
  240. function clickEnded()
  241. button1Down = false
  242. end
  243.  
  244. function holdDistanceChanged()
  245. dragRange = dragRangeMax--[[_G.dragRangeMin + (1 - dist) * (dragRangeMax - _G.dragRangeMin)]]
  246. end
  247.  
  248.  
  249. function canDrag(targetObject)
  250.  
  251.  
  252. if not (targetObject and not targetObject.Anchored and targetObject.Parent and Humanoid.Health > 0) then -- General conditions
  253. return false
  254. end
  255.  
  256. if targetObject.Name == "LeafPart" then
  257. return false
  258. end
  259.  
  260. local originTargetObject = targetObject
  261. targetObject = findHighestParent(targetObject) or targetObject
  262.  
  263. bodyGyro.Parent = dragPart
  264.  
  265.  
  266. --[[if not (targetObject.Parent:FindFirstChild("Owner") or targetObject.Parent.Parent:FindFirstChild("Owner")) then
  267. return otherDraggable(targetObject, originTargetObject)
  268. end]]
  269.  
  270. if targetObject.Parent:FindFirstChild("Owner") or targetObject.Parent.Parent:FindFirstChild("Owner") then
  271. return true
  272. end
  273.  
  274. if targetObject.Parent:FindFirstChild("TreeClass") then -- Wood class
  275. return true
  276. end
  277. if targetObject.Parent:FindFirstChild("BoxItemName") then -- Shop items
  278. return true
  279. end
  280. if targetObject.Parent:FindFirstChild("PurchasedBoxItemName") then -- Purchased box items
  281. return true
  282. end
  283. if targetObject.Parent:FindFirstChild("Handle") then -- Tool items
  284. return true
  285. end
  286.  
  287. return otherDraggable(targetObject, originTargetObject)
  288. end
  289.  
  290. function otherDraggable(targetObject, originTargetObject)
  291. local draggable = targetObject and targetObject.Parent and targetObject.Parent:FindFirstChild("DraggableItem") or originTargetObject and originTargetObject.Parent and originTargetObject.Parent:FindFirstChild("DraggableItem")
  292. if draggable then -- Other stuff
  293. if draggable:FindFirstChild("NoRotate") then
  294. bodyGyro.Parent = nil
  295. end
  296. return true
  297. end
  298. end
  299.  
  300. function initializeDrag(targetObject,mouseHit)
  301. draggingPart = true
  302. mouse.TargetFilter = targetObject and findHighestParent(targetObject) and findHighestParent(targetObject).Parent or targetObject
  303.  
  304. dragPart.CFrame = CFrame.new(mouseHit, camera.CoordinateFrame.p)
  305.  
  306. weld.Part0 = dragPart
  307. weld.Part1 = targetObject
  308. weld.C0 = CFrame.new(mouseHit,camera.CoordinateFrame.p):inverse() * targetObject.CFrame
  309. weld.Parent = dragPart
  310.  
  311. dragPart.Parent = workspace
  312. end
  313.  
  314. function endDrag()
  315. mouse.TargetFilter = nil
  316. dragPart.Parent = nil
  317. draggingPart = false
  318. end
  319.  
  320. --------------------------------[[ Do Prompt ]]------------------------------------
  321.  
  322.  
  323. local dragGuiState = ""
  324. function interactLoop()
  325. while true do
  326. wait()
  327.  
  328. local newState = ""
  329.  
  330. local mouseHit = game.Players.LocalPlayer:GetMouse().Hit.p
  331. local targetObject = game.Players.LocalPlayer:GetMouse().Target
  332.  
  333.  
  334. if draggingPart then
  335. newState = "Dragging"
  336. elseif canDrag(targetObject) and not button1Down and (mouseHit - Character.Head.Position).magnitude < dragRangeMax then
  337. newState = "Mouseover"
  338. end
  339.  
  340. if true then-- not (newState == dragGuiState) then
  341. dragGuiState = newState
  342. setPlatformControls()
  343.  
  344. if dragGuiState == "" then
  345. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.Visible = false
  346. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.Visible = false
  347. elseif dragGuiState == "Mouseover" then
  348. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.Visible = true
  349. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.Visible = false
  350. elseif dragGuiState == "Dragging" then
  351. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.Visible = false
  352. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.Visible = not (bodyGyro.Parent == nil) and (not player:FindFirstChild("IsChatting") or player.IsChatting.Value < 1)
  353. end
  354. end
  355.  
  356. end
  357. end
  358.  
  359.  
  360. --------------------------------[[ Drag Moving ]]------------------------------------
  361.  
  362.  
  363. function moveDrag(pos)
  364. bodyPosition.position = pos
  365. end
  366. local rotateSpeedReduce = 0.036
  367.  
  368. local lastRotateTick
  369. function crotate(amount, speed)
  370.  
  371. if not draggingPart then
  372. if not player:FindFirstChild("IsChatting") or player.IsChatting.Value < 2 then
  373. Humanoid.WalkSpeed = walkSpeed
  374. end
  375. return
  376. end
  377.  
  378. if Humanoid.WalkSpeed > 1 then
  379. walkSpeed = Humanoid.WalkSpeed
  380. Humanoid.WalkSpeed = 0
  381. end
  382.  
  383. lastRotateTick = tick()
  384. local thisRotateTick = lastRotateTick
  385.  
  386. while draggingPart and amount.magnitude > 0 and lastRotateTick == thisRotateTick do
  387. rotateCFrame = CFrame.Angles(0, -amount.X * rotateSpeedReduce, 0) * CFrame.Angles(amount.Y * rotateSpeedReduce, 0, 0) * rotateCFrame
  388. wait()
  389. end
  390.  
  391. if amount.magnitude == 0 then
  392. if not player:FindFirstChild("IsChatting") or player.IsChatting.Value < 2 then
  393. Humanoid.WalkSpeed = walkSpeed
  394. end
  395. end
  396. end
  397.  
  398. --------------------------------[[ User Input ]]------------------------------------
  399.  
  400. wait(1)
  401.  
  402. carryAnimationTrack = Humanoid:LoadAnimation(game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.Dragger:WaitForChild("CarryItem"))
  403.  
  404. --input = require(game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.Parent:WaitForChild("Scripts"):WaitForChild("UserInput"))
  405.  
  406. game.Players.LocalPlayer:GetMouse().Button1Down:connect(function()
  407. click()
  408. holdDistanceChanged()
  409. end)
  410. game.Players.LocalPlayer:GetMouse().Button1Up:connect(function()
  411. clickEnded()
  412. end)
  413. --input.ClickBegan(click, holdDistanceChanged)
  414. --input.ClickEnded(clickEnded)
  415.  
  416. --input.Rotate(crotate)
  417.  
  418.  
  419. function setPlatformControls()
  420. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.PlatformButton.Image = game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.PlatformButton.PC.Value
  421. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanDrag.PlatformButton.KeyLabel.Text = "CLICK"
  422. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.PlatformButton.Image = game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.PlatformButton.PC.Value
  423. game.Players.LocalPlayer.PlayerGui.ItemDraggingGUI.CanRotate.PlatformButton.KeyLabel.Text = "SHIFT + WASD"
  424. end
  425.  
  426.  
  427. interactLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement