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

How do I make an invisibility tool which also hides the Armor on the character?

Asked by 3 years ago
Edited 3 years ago

So, I've been trying a lot lately to make a script that hides the character body parts AND the morphs' Armor as well. Basically, the Armor parts are called "Arm1", "Leg1","Chest","Helmet". You get the point, those are examples, I've tried by making a script which makes them transparent but it didn't work and nothing so far did.

Invisible = script.Parent
Invisible.Equipped:connect(function() 
    Player = script.Parent.Parent
    Player.Head.Transparency = 0.5 wait(0.1) Player.Head.Transparency = 1
    Player.Torso.Transparency = 0.5 wait(0.1) Player.Torso.Transparency = 1
    Player["Left Arm"].Transparency = 0.5 wait(0.1) Player["Left Arm"].Transparency = 1
    Player["Right Arm"].Transparency = 0.5 wait(0.1) Player["Right Arm"].Transparency = 1
    Player["Right Leg"].Transparency = 0.5 wait(0.1) Player["Right Leg"].Transparency = 1
    Player["Left Leg"].Transparency = 0.5 wait(0.1) Player["Left Leg"].Transparency = 1
    Player.Head.face.Transparency = 0.5 wait(0.1) Player.Head.face.Transparency = 1

    Player = script.Parent.Parent
    Player.Arm1.Transparency = 0.5 wait(0.1) Player.Arm1.Transparency = 1
    Player.Arm2.Transparency = 0.5 wait(0.1) Player.Arm2.Transparency = 1
    Player.Leg1.Transparency = 0.5 wait(0.1) Player.Leg1.Transparency = 1
    Player.Leg2.Transparency = 0.5 wait(0.1) Player.Leg2.Transparency = 1
    Player.Helmet.Transparency = 0.5 wait(0.1) Player.Helmet.Transparency = 1
    Player.Chest.Transparency = 0.5 wait(0.1) Player.Chest.Transparency = 1
end)

Invisible.Unequipped:connect(function() 
    Player.Head.Transparency = 0.5 wait(0.1) Player.Head.Transparency = 0
    Player.Torso.Transparency = 0.5 wait(0.1) Player.Torso.Transparency = 0
    Player["Left Arm"].Transparency = 0.5 wait(0.1) Player["Left Arm"].Transparency = 0
    Player["Right Arm"].Transparency = 0.5 wait(0.1) Player["Right Arm"].Transparency = 0
    Player["Right Leg"].Transparency = 0.5 wait(0.1) Player["Right Leg"].Transparency = 0
    Player["Left Leg"].Transparency = 0.5 wait(0.01) Player["Left Leg"].Transparency = 0
    Player.Head.face.Transparency = 0.5 wait(0.1) Player.Head.face.Transparency = 0
end)
0
So the tool should be invisible or what is your problem? GermandevsCEO 1 — 3y
0
An invisibility tool SurfyStefanos 8 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I feel like you're missing the point. You're doing the wrong thing if you want everything invisible. You must use for loops and the spawn function I tested this script and I think this is what you want

local Tool = script.Parent
local Equipped = false
Tool.Equipped:Connect(function()
    Equipped = true
    for _,part in pairs(workspace.MikePetar:GetDescendants()) do
        if part:IsA'BasePart' and part.Name ~= "HumanoidRootPart" then
            spawn(function()
                for i = 0,1.01,.1 do
                    if Equipped == false then
                        break
                    end
                    wait(.02)
                    part.Transparency = i 
                end
            end)
        elseif part:IsA("Decal") and part.Parent.Name == "Head" then
            spawn(function()
                for i = 0,1.01,.1 do
                    if Equipped == false then
                        break
                    end
                    wait(.02)
                    part.Transparency = i 
                end
            end)
        end
    end
end)
Tool.Unequipped:Connect(function()
    Equipped = false
    for _,part in pairs(Tool.Parent.Parent.Character:GetDescendants()) do
        if part:IsA'BasePart' and part.Name ~= "HumanoidRootPart" then
            spawn(function()
                for i = 1,0,-0.1 do
                    if Equipped == true then
                        break
                    end
                    wait(.02)
                    part.Transparency = i
                end
                return
            end)
        elseif part:IsA("Decal") and part.Parent.Name == "Head" then
            spawn(function()
                for i = 1,0,-0.1 do
                    if Equipped == true then
                        break
                    end
                    wait(.02)
                    part.Transparency = i
                end
                return
            end)
        end
    end
end)



0
Thank you for the answer, many people recommended it but I simply ignored it because I thought it didn't work. SurfyStefanos 8 — 3y
0
You're welcome :) MiAiHsIs1226 189 — 3y
Ad

Answer this question