Meliodas0_0

Fe toggle invisible

Jan 30th, 2020
181
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Just chat ";invis" to go invisible and ";vis" to go visible.
  2. or "/e ;invis" or "/e ;vis"
  3.  
  4. Code:
  5. local plr = game:GetService("Players").LocalPlayer
  6. repeat wait() until plr.Character
  7. repeat wait() until plr.Character.HumanoidRootPart
  8. local char = plr.Character
  9. char.Archivable = true
  10. local clone = char:Clone()
  11. clone.Parent = game:GetService("LocalizationService")
  12. local POI = "false"
  13. local prefix = ";"
  14. local CCF = CFrame.new()
  15.  
  16.  
  17.  
  18. local DummySs = Instance.new("Sound")
  19. DummySs.Name = "Died"
  20.  
  21. DummySs.Parent = game:GetService("SoundService")
  22.  
  23. local DummyS = game:GetService("SoundService"):WaitForChild("Died")
  24.  
  25. plr.Chatted:Connect(function(c)
  26. if c:sub(1,6) == prefix.."invis" or c:sub(1,9) == "/e "..prefix.."invis" then
  27. if POI == "false" then
  28. POI = "true"
  29. DummyS:Clone().Parent = clone.Head
  30. char = workspace[plr.Name]
  31. CCF = plr.Character.HumanoidRootPart.CFrame
  32. wait(.02)
  33. plr.Character.HumanoidRootPart.CFrame = CFrame.new(23094,23451,123582)
  34. wait(.2)
  35. plr.Character.HumanoidRootPart.Anchored = true
  36. wait(.2)
  37. plr.Character = clone
  38. clone.Parent = workspace.Terrain
  39. clone.HumanoidRootPart.CFrame = CCF
  40. workspace.CurrentCamera.CameraSubject = clone
  41. end
  42. elseif c:sub(1,4) == prefix.."vis" or c:sub(1,7) == "/e "..prefix.."vis" then
  43. if POI == "true" then
  44. POI = "false"
  45. DummyS:Clone().Parent = char.Head
  46. CCF = clone.HumanoidRootPart.CFrame
  47. plr.Character = char
  48. clone.Parent = game:GetService("LocalizationService")
  49. wait(.2)
  50. char.HumanoidRootPart.Anchored = false
  51. wait(.2)
  52. char.HumanoidRootPart.CFrame = CCF
  53. workspace.CurrentCamera.CameraSubject = char
  54. end
  55. end
  56. if c == ";stop" then
  57. script:Destroy()
  58. if game:GetService("LocalizationService"):FindFirstChild(plr.Name) then
  59. game:GetService("LocalizationService"):FindFirstChild(plr.Name):Destroy()
  60. elseif workspace.Terrain:FindFirstChild(plr.Name) then
  61. workspace.Terrain:FindFirstChild(plr.Name):Destroy()
  62. plr.Character = workspace[plr.Name]
  63. end
  64. end
  65. end)
  66.  
  67. clone.Humanoid.Died:Connect(function()
  68. POI = "Unusable"
  69. plr.Character = char
  70. DummyS:Clone().Parent = clone.Head
  71. wait(.5)
  72. game:GetService("Players").LocalPlayer.Character:BreakJoints()
  73. clone:Destroy()
  74. wait(.5)
  75. script:Destroy()
  76. end)
  77. char.Humanoid.Died:Connect(function()
  78. POI = "Unusable"
  79. DummyS:Clone().Parent = char.Head
  80. if clone ~= nil then
  81. clone:Destroy()
  82. wait(.5)
  83. script:Destroy()
  84. end
  85. end)
RAW Paste Data