This is the script:
tool = script.Parent
player = game.Players.LocalPlayer
toggle = false
folder = nil
function CreateFolder()
if player:FindFirstChildClass("Folder") == nil then
folder = Instance.new("Folder", player)
folder.Name = "Accessories"
end
end
local function MoveAccessories(str)
if str == "Player" then
accessories = folder:GetChildren()
elseif str == "Folder" then
accessories = player.Character:GetChildren()
end
end
CreateFolder()
function Toggle()
if toggle == false then
toggle = true
else
toggle =false
end
end
function SetVisibility()
local function SetPartVisible(trans)
local human = player.Character:GetChildren()
for i, part in ipairs(human) do
if part:IsA("Part")and part.Name == "HumanoidRoot" then
if str == "Player" then
item.Parent = player.Character
elseif str == "Folder" then
item.Parent = folder
end
end
end
end
local function MoveFace(str)
if str == "Player" then
folder.face.Parent = player.Character.Head.
elseif str == "Folder" then
player.Character.head.face.Parent = folder
end
if toggle == true then
SetPartVisible(1)
MoveAccessories("Folder")
MoveFace("Folder")
else
SetPartVisible(0)
MoveAccessories ("Player")
MoveFace("Player")
end
end
tool.Activated:connect(function()
toggle()
SetVisibility()
end)

3 comments
you can use the roblox invisible cape that's already made
Any errors?
No errors, but when I click it it wont go invisible. It doesn't give any errors in the output. But the tool doesn't work.