Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a tool that turns the player invisible?

Asked by 5 years ago

So i know how to make parts transparent and all but I can't seem to figure out how to get the user's part invisible when used. Can someone please tell me what function i need to use?

2 answers

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
5 years ago
Edited 5 years ago
local holder = Instance.new("Folder",game.Lighting)
holder.Name = "Accessory Storage"
script.Parent.Activated:Connect(function()
game.Players.LocalPlayer.Character.Head.face.Parent = holder
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == "MeshPart" then 
v.Transparency = 1
end
game.Players.LocalPlayer.Character.Head.Transparency = 1
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
    if v.ClassName == "Accessory" then
        v.Parent = holder
    end
end
end
wait(5)
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == "MeshPart" then
v.Transparency = 0
end

game.Players.LocalPlayer.Character.Head.Transparency = 0
for i,v in pairs (holder:GetChildren()) do
    if v.ClassName == "Accessory" then
        v.Parent = game.Players.LocalPlayer.Character
    end
end
end
holder.face.Parent = game.Players.LocalPlayer.Character.Head
end)
0
added wait(5) and v.Transparency = 1 after game,Players.LocalPlayer... RealRexTerm 21 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
local tool = script.Parent
local plr = script.Parent.Parent.Parent -- The Player holding the tool
tool.Activated:Connect(function()
    if plr.Character.Humanoid.RigType = Enum.HumanoidRigType.R6 then -- Check for R6
        plr.Character.Torso.Transparency = 1
        plr.Character["Right Arm"].Transparency = 1
        plr.Character["Right Leg"].Transparency = 1
        plr.Character["Left Arm"].Transparency = 1
        plr.Character["Left Leg"].Transparency = 1
        plr.Character.HumanoidRootPart.Transparency = 1
        plr.Character.Head.Transparency = 1
    end
    if plr.Character.Humanoid.RigType = Enum.HumanoidRigType.R15 then -- Check for R15
        plr.Character.HumanoidRootPart.Transparency = 1
        plr.Character.Head.Transparency = 1
        plr.Character.UpperTorso.Transparency = 1
        plr.Character.LowerTorso.Transparency = 1
        plr.Character.LeftUpperArm.Transparency = 1
        plr.Character.LeftLowerArm.Transparency = 1
        plr.Character.LeftHand.Transparency = 1
        plr.Character.RightUpperArm.Transparency = 1
        plr.Character.RightLowerArm.Transparency = 1
        plr.Character.RightHand.Transparency = 1
        plr.Character.LeftUpperLeg.Transparency = 1
        plr.Character.LeftLowerLeg.Transparency = 1
        plr.Character.LeftFoot.Transparency = 1
        plr.Character.RightUpperLeg.Transparency = 1
        plr.Character.RightLowerLeg.Transparency = 1
        plr.Character.RightFoot.Transparency = 1
    end
end)
tool.Deactivated:Connect(function()
    if plr.Character.Humanoid.RigType = Enum.HumanoidRigType.R6 then -- Check for R6
        plr.Character.Torso.Transparency = 0
        plr.Character["Right Arm"].Transparency = 0
        plr.Character["Right Leg"].Transparency = 0
        plr.Character["Left Arm"].Transparency = 0
        plr.Character["Left Leg"].Transparency = 0
        plr.Character.HumanoidRootPart.Transparency = 0
        plr.Character.Head.Transparency = 0
    end
    if plr.Character.Humanoid.RigType = Enum.HumanoidRigType.R15 then -- Check for R15
        plr.Character.HumanoidRootPart.Transparency = 0
        plr.Character.Head.Transparency = 0
        plr.Character.UpperTorso.Transparency = 0
        plr.Character.LowerTorso.Transparency = 0
        plr.Character.LeftUpperArm.Transparency = 0
        plr.Character.LeftLowerArm.Transparency = 0
        plr.Character.LeftHand.Transparency = 0
        plr.Character.RightUpperArm.Transparency = 0
        plr.Character.RightLowerArm.Transparency = 0
        plr.Character.RightHand.Transparency = 0
        plr.Character.LeftUpperLeg.Transparency = 0
        plr.Character.LeftLowerLeg.Transparency = 0
        plr.Character.LeftFoot.Transparency = 0
        plr.Character.RightUpperLeg.Transparency = 0
        plr.Character.RightLowerLeg.Transparency = 0
        plr.Character.RightFoot.Transparency = 0
    end
end)

If you have any questions, please ask.

Answer this question