Advertisement
Jan_Simon12

Dhms

Jun 11th, 2022
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. --Settings:
  2. local ScriptStarted = false
  3. local Keybind = "M" --Set to whatever you want, has to be the name of a KeyCode Enum.
  4. local Transparency = true --Will make you slightly transparent when you are invisible. No reason to disable.
  5. local NoClip = false --Will make your fake character no clip.
  6.  
  7. local Player = game:GetService("Players").LocalPlayer
  8. local RealCharacter = Player.Character or Player.CharacterAdded:Wait()
  9.  
  10. local IsInvisible = false
  11.  
  12. RealCharacter.Archivable = true
  13. local FakeCharacter = RealCharacter:Clone()
  14. local Part
  15. Part = Instance.new("Part", workspace)
  16. Part.Anchored = true
  17. Part.Size = Vector3.new(200, 1, 200)
  18. Part.CFrame = CFrame.new(9999, 9999, 9999) --Set this to whatever you want, just far away from the map.
  19. Part.CanCollide = true
  20. FakeCharacter.Parent = workspace
  21. FakeCharacter.HumanoidRootPart.CFrame = Part.CFrame * CFrame.new(0, 5, 0)
  22.  
  23. for i, v in pairs(RealCharacter:GetChildren()) do
  24. if v:IsA("LocalScript") then
  25. local clone = v:Clone()
  26. clone.Disabled = true
  27. clone.Parent = FakeCharacter
  28. end
  29. end
  30. if Transparency then
  31. for i, v in pairs(FakeCharacter:GetDescendants()) do
  32. if v:IsA("BasePart") then
  33. v.Transparency = 0.7
  34. end
  35. end
  36. end
  37. local CanInvis = true
  38. function RealCharacterDied()
  39. CanInvis = false
  40. RealCharacter:Destroy()
  41. RealCharacter = Player.Character
  42. CanInvis = true
  43. isinvisible = false
  44. FakeCharacter:Destroy()
  45. workspace.CurrentCamera.CameraSubject = RealCharacter.Humanoid
  46.  
  47. RealCharacter.Archivable = true
  48. FakeCharacter = RealCharacter:Clone()
  49. Part:Destroy()
  50. Part = Instance.new("Part", workspace)
  51. Part.Anchored = true
  52. Part.Size = Vector3.new(200, 1, 200)
  53. Part.CFrame = CFrame.new(9999, 9999, 9999) --Set this to whatever you want, just far away from the map.
  54. Part.CanCollide = true
  55. FakeCharacter.Parent = workspace
  56. FakeCharacter.HumanoidRootPart.CFrame = Part.CFrame * CFrame.new(0, 5, 0)
  57.  
  58. for i, v in pairs(RealCharacter:GetChildren()) do
  59. if v:IsA("LocalScript") then
  60. local clone = v:Clone()
  61. clone.Disabled = true
  62. clone.Parent = FakeCharacter
  63. end
  64. end
  65. if Transparency then
  66. for i, v in pairs(FakeCharacter:GetDescendants()) do
  67. if v:IsA("BasePart") then
  68. v.Transparency = 0.7
  69. end
  70. end
  71. end
  72. RealCharacter.Humanoid.Died:Connect(function()
  73. RealCharacter:Destroy()
  74. FakeCharacter:Destroy()
  75. end)
  76. Player.CharacterAppearanceLoaded:Connect(RealCharacterDied)
  77. end
  78. RealCharacter.Humanoid.Died:Connect(function()
  79. RealCharacter:Destroy()
  80. FakeCharacter:Destroy()
  81. end)
  82. Player.CharacterAppearanceLoaded:Connect(RealCharacterDied)
  83. local PseudoAnchor
  84. game:GetService "RunService".RenderStepped:Connect(
  85. function()
  86. if PseudoAnchor ~= nil then
  87. PseudoAnchor.CFrame = Part.CFrame * CFrame.new(0, 5, 0)
  88. end
  89. if NoClip then
  90. FakeCharacter.Humanoid:ChangeState(11)
  91. end
  92. end
  93. )
  94.  
  95. PseudoAnchor = FakeCharacter.HumanoidRootPart
  96. local function Invisible()
  97. if IsInvisible == false then
  98. local StoredCF = RealCharacter.HumanoidRootPart.CFrame
  99. RealCharacter.HumanoidRootPart.CFrame = FakeCharacter.HumanoidRootPart.CFrame
  100. FakeCharacter.HumanoidRootPart.CFrame = StoredCF
  101. RealCharacter.Humanoid:UnequipTools()
  102. Player.Character = FakeCharacter
  103. workspace.CurrentCamera.CameraSubject = FakeCharacter.Humanoid
  104. PseudoAnchor = RealCharacter.HumanoidRootPart
  105. for i, v in pairs(FakeCharacter:GetChildren()) do
  106. if v:IsA("LocalScript") then
  107. v.Disabled = false
  108. end
  109. end
  110.  
  111. IsInvisible = true
  112. else
  113. local StoredCF = FakeCharacter.HumanoidRootPart.CFrame
  114. FakeCharacter.HumanoidRootPart.CFrame = RealCharacter.HumanoidRootPart.CFrame
  115.  
  116. RealCharacter.HumanoidRootPart.CFrame = StoredCF
  117.  
  118. FakeCharacter.Humanoid:UnequipTools()
  119. Player.Character = RealCharacter
  120. workspace.CurrentCamera.CameraSubject = RealCharacter.Humanoid
  121. PseudoAnchor = FakeCharacter.HumanoidRootPart
  122. for i, v in pairs(FakeCharacter:GetChildren()) do
  123. if v:IsA("LocalScript") then
  124. v.Disabled = true
  125. end
  126. end
  127. IsInvisible = false
  128. end
  129. end
  130.  
  131. game:GetService("UserInputService").InputBegan:Connect(
  132. function(key, gamep)
  133. if gamep then
  134. return
  135. end
  136. if key.KeyCode.Name:lower() == Keybind:lower() and CanInvis and RealCharacter and FakeCharacter then
  137. if RealCharacter:FindFirstChild("HumanoidRootPart") and FakeCharacter:FindFirstChild("HumanoidRootPart") then
  138. Invisible()
  139. end
  140. end
  141. end
  142. )
  143. local Sound = Instance.new("Sound",game:GetService("SoundService"))
  144. Sound.SoundId = "rbxassetid://232127604"
  145. Sound:Play()
  146. game:GetService("StarterGui"):SetCore("SendNotification",{["Title"] = "Invisible Toggle Loaded",["Text"] = "Press "..Keybind.." to become change visibility.",["Duration"] = 20,["Button1"] = "Okay."})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement