0% found this document useful (0 votes)
4 views

message (2)

The script allows a player to toggle invisibility in a game by pressing a specified key. It creates a fake character that can be made transparent and can optionally no-clip through objects. The script handles character death by resetting the fake character and maintaining functionality for local scripts within the character model.

Uploaded by

aliyevali993344
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

message (2)

The script allows a player to toggle invisibility in a game by pressing a specified key. It creates a fake character that can be made transparent and can optionally no-clip through objects. The script handles character death by resetting the fake character and maintaining functionality for local scripts within the character model.

Uploaded by

aliyevali993344
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

local ScriptStarted = false

local Keybind = "E" --Set to whatever you want, has to be the name of a KeyCode
Enum.
local Transparency = true --Will make you slightly transparent when you are
invisible. No reason to disable.
local NoClip = false --Will make your fake character no clip.

local Player = game:GetService("Players").LocalPlayer


local RealCharacter = Player.Character or Player.CharacterAdded:Wait()

local IsInvisible = false

RealCharacter.Archivable = true
local FakeCharacter = RealCharacter:Clone()
local Part
Part = Instance.new("Part", workspace)
Part.Anchored = true
Part.Size = Vector3.new(200, 1, 200)
Part.CFrame = CFrame.new(0, -500, 0) --Set this to whatever you want, just far away
from the map.
Part.CanCollide = true
FakeCharacter.Parent = workspace
FakeCharacter.HumanoidRootPart.CFrame = Part.CFrame * CFrame.new(0, 5, 0)

for i, v in pairs(RealCharacter:GetChildren()) do
if v:IsA("LocalScript") then
local clone = v:Clone()
clone.Disabled = true
clone.Parent = FakeCharacter
end
end
if Transparency then
for i, v in pairs(FakeCharacter:GetDescendants()) do
if v:IsA("BasePart") then
v.Transparency = 0.7
end
end
end
local CanInvis = true
function RealCharacterDied()
CanInvis = false
RealCharacter:Destroy()
RealCharacter = Player.Character
CanInvis = true
isinvisible = false
FakeCharacter:Destroy()
workspace.CurrentCamera.CameraSubject = RealCharacter.Humanoid

RealCharacter.Archivable = true
FakeCharacter = RealCharacter:Clone()
Part:Destroy()
Part = Instance.new("Part", workspace)
Part.Anchored = true
Part.Size = Vector3.new(200, 1, 200)
Part.CFrame = CFrame.new(9999, 9999, 9999) --Set this to whatever you want, just
far away from the map.
Part.CanCollide = true
FakeCharacter.Parent = workspace
FakeCharacter.HumanoidRootPart.CFrame = Part.CFrame * CFrame.new(0, 5, 0)
for i, v in pairs(RealCharacter:GetChildren()) do
if v:IsA("LocalScript") then
local clone = v:Clone()
clone.Disabled = true
clone.Parent = FakeCharacter
end
end
if Transparency then
for i, v in pairs(FakeCharacter:GetDescendants()) do
if v:IsA("BasePart") then
v.Transparency = 0.7
end
end
end
RealCharacter.Humanoid.Died:Connect(function()
RealCharacter:Destroy()
FakeCharacter:Destroy()
end)
Player.CharacterAppearanceLoaded:Connect(RealCharacterDied)
end
RealCharacter.Humanoid.Died:Connect(function()
RealCharacter:Destroy()
FakeCharacter:Destroy()
end)
Player.CharacterAppearanceLoaded:Connect(RealCharacterDied)
local PseudoAnchor
game:GetService "RunService".RenderStepped:Connect(
function()
if PseudoAnchor ~= nil then
PseudoAnchor.CFrame = Part.CFrame * CFrame.new(0, 5, 0)
end
if NoClip then
FakeCharacter.Humanoid:ChangeState(11)
end
end
)

PseudoAnchor = FakeCharacter.HumanoidRootPart
local function Invisible()
if IsInvisible == false then
local StoredCF = RealCharacter.HumanoidRootPart.CFrame
RealCharacter.HumanoidRootPart.CFrame = FakeCharacter.HumanoidRootPart.CFrame
FakeCharacter.HumanoidRootPart.CFrame = StoredCF
RealCharacter.Humanoid:UnequipTools()
Player.Character = FakeCharacter
workspace.CurrentCamera.CameraSubject = FakeCharacter.Humanoid
PseudoAnchor = RealCharacter.HumanoidRootPart
for i, v in pairs(FakeCharacter:GetChildren()) do
if v:IsA("LocalScript") then
v.Disabled = false
end
end

IsInvisible = true
else
local StoredCF = FakeCharacter.HumanoidRootPart.CFrame
FakeCharacter.HumanoidRootPart.CFrame = RealCharacter.HumanoidRootPart.CFrame
RealCharacter.HumanoidRootPart.CFrame = StoredCF

FakeCharacter.Humanoid:UnequipTools()
Player.Character = RealCharacter
workspace.CurrentCamera.CameraSubject = RealCharacter.Humanoid
PseudoAnchor = FakeCharacter.HumanoidRootPart
for i, v in pairs(FakeCharacter:GetChildren()) do
if v:IsA("LocalScript") then
v.Disabled = true
end
end
IsInvisible = false
end
end

game:GetService("UserInputService").InputBegan:Connect(
function(key, gamep)
if gamep then
return
end
if key.KeyCode.Name:lower() == Keybind:lower() and CanInvis and RealCharacter
and FakeCharacter then
if RealCharacter:FindFirstChild("HumanoidRootPart") and
FakeCharacter:FindFirstChild("HumanoidRootPart") then
Invisible()
end
end
end
)
local Sound = Instance.new("Sound",game:GetService("SoundService"))
Sound.SoundId = "rbxassetid://232127604"
Sound:Play()
game:GetService("StarterGui"):SetCore("SendNotification",{["Title"] = "Invisible
Toggle Loaded",["Text"] = "Press "..Keybind.." to become change visibility.",
["Duration"] = 20,["Button1"] = "Okay."})

You might also like