rrixh

fe invisible tool

Jun 16th, 2023
2,643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. local offset = 1100
  2. local invisible = game.Players.LocalPlayer
  3. local grips = {}
  4. local heldTool
  5. local gripChanged
  6. local handle
  7. local weld
  8. function setDisplayDistance(distance)
  9. for _, player in pairs(game.Players:GetPlayers()) do
  10. if player.Character and player.Character:FindFirstChildWhichIsA("Humanoid") then
  11. player.Character:FindFirstChildWhichIsA("Humanoid").NameDisplayDistance = distance
  12. player.Character:FindFirstChildWhichIsA("Humanoid").HealthDisplayDistance = distance
  13. end
  14. end
  15. end
  16. local tool = Instance.new("Tool", game.Players.LocalPlayer.Backpack)
  17. tool.Name = "Invisible"
  18. tool.RequiresHandle = false
  19. tool.CanBeDropped = false
  20. tool.Equipped:Connect(
  21. function()
  22. wait()
  23. if not invisible then
  24. invisible = true
  25. tool.Name = "Enabled Invisible"
  26. if handle then
  27. handle:Destroy()
  28. end
  29. if weld then
  30. weld:Destroy()
  31. end
  32. handle = Instance.new("Part", workspace)
  33. handle.Name = "Handle"
  34. handle.Transparency = 1
  35. handle.CanCollide = false
  36. handle.Size = Vector3.new(2, 1, 1)
  37. weld = Instance.new("Weld", handle)
  38. weld.Part0 = handle
  39. weld.Part1 = game.Players.LocalPlayer.Character.HumanoidRootPart
  40. weld.C0 = CFrame.new(0, offset - 1.5, 0)
  41. setDisplayDistance(offset + 100)
  42. workspace.CurrentCamera.CameraSubject = handle
  43. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0, offset, 0)
  44. game.Players.LocalPlayer.Character.Humanoid.HipHeight = offset
  45. game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
  46. for _, child in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  47. if child:IsA("Tool") and child ~= tool then
  48. grips[child] = child.Grip
  49. end
  50. end
  51. elseif invisible then
  52. invisible = false
  53. tool.Name = "Disabled Invisible"
  54. if handle then
  55. handle:Destroy()
  56. end
  57. if weld then
  58. weld:Destroy()
  59. end
  60. for _, child in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  61. if child:IsA("Tool") then
  62. child.Parent = game.Players.LocalPlayer.Backpack
  63. end
  64. end
  65. for tool, grip in pairs(grips) do
  66. if tool then
  67. tool.Grip = grip
  68. end
  69. end
  70. heldTool = nil
  71. setDisplayDistance(100)
  72. workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  73. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0, -offset, 0)
  74. game.Players.LocalPlayer.Character.Humanoid.HipHeight = 0
  75. end
  76. tool.Parent = game.Players.LocalPlayer.Backpack
  77. end
  78. )
  79. game.Players.LocalPlayer.Character.ChildAdded:Connect(
  80. function(child)
  81. wait()
  82. if invisible and child:IsA("Tool") and child ~= heldTool and child ~= tool then
  83. heldTool = child
  84. local lastGrip = heldTool.Grip
  85. if not grips[heldTool] then
  86. grips[heldTool] = lastGrip
  87. end
  88. for _, track in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
  89. track:Stop()
  90. end
  91. game.Players.LocalPlayer.Character.Animate.Disabled = true
  92. heldTool.Grip = heldTool.Grip * (CFrame.new(0, offset - 1.5, 1.5) * CFrame.Angles(math.rad(-90), 0, 0))
  93. heldTool.Parent = game.Players.LocalPlayer.Backpack
  94. heldTool.Parent = game.Players.LocalPlayer.Character
  95. if gripChanged then
  96. gripChanged:Disconnect()
  97. end
  98. gripChanged =
  99. heldTool:GetPropertyChangedSignal("Grip"):Connect(
  100. function()
  101. wait()
  102. if not invisible then
  103. gripChanged:Disconnect()
  104. end
  105. if heldTool.Grip ~= lastGrip then
  106. lastGrip =
  107. heldTool.Grip * (CFrame.new(0, offset - 1.5, 1.5) * CFrame.Angles(math.rad(-90), 0, 0))
  108. heldTool.Grip = lastGrip
  109. heldTool.Parent = game.Players.LocalPlayer.Backpack
  110. heldTool.Parent = game.Players.LocalPlayer.Character
  111. end
  112. end
  113. )
  114. end
  115. end
  116. )
Add Comment
Please, Sign In to add comment