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

why won't my accessories become invisible?

Asked by 5 years ago

my body parts do but when i become invisible all i see if my beard, hair etc. how do i fix that?

function setTransparency(char, value)

for _, child in pairs(char:GetChildren()) do

if child:IsA('Hat') and child:IsA("Accessory") and child:FindFirstChild("Handle")   then

child = child.Handle

elseif child:IsA("BasePart") and child.Name ~= "HumanoidRootPart"  then

child.Transparency = value
end
end
end

local enabled = true

game.Workspace.inva.Touched:connect(function(hit)

local char = hit.Parent

if char then

local head = char:FindFirstChild("Head")

local face = head:FindFirstChild("face")

if enabled and head and game.Players:GetPlayerFromCharacter(char) then

enabled = false

for t = 0, 1, .1 do

if face then face.Transparency = t end

setTransparency(char, t)

wait(0.1)

end

wait(10)

for t = 1, 0, -.1 do

if face then face.Transparency = t end

setTransparency(char, t)

wait(0.1)

end

wait(2)

enabled = true

end
end
end)
0
You want to become invisible? Like all invisible :D???? If so I can help u namespace25 594 — 5y
0
yes. the script works, i just need to help finding out why my hair, bear, etc isn't becoming invisible with my body parts. body parts become invisible but not the accessories for some reason. A1exTatum 57 — 5y
0
sorry for the poor grammar, was typing a lil fast e.e A1exTatum 57 — 5y
0
Try that :D I cannot really point out what is wrong with your script but this one should work :D namespace25 594 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
local selectedTransparency

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(chr)
        delay(.5, function()
            --// Function delay to make sure the character has been added.
            if chr then
                for _,parts in pairs(chr:GetChildren()) do
                    wait()
                    if parts:IsA("BasePart") or parts:IsA("Part") or parts:IsA("MeshPart") or parts:IsA("GuiBase3d") or parts:IsA("Decal") then
                        selectedTransparency = 1
                        parts.Transparency = selectedTransparency
                        wait()
                    else
                    if parts:IsA("Accessory") then --// Ghost Mode
                        parts:Remove() --// Don't have to add this.
                    end
                    end
                    for _,parts_2 in pairs(parts:GetChildren()) do
                        if parts_2:IsA("Decal") then
                            parts_2.Transparency = 1 --// Will remove the face
                        end
                    end
                end
            end
        end)
    end)
end)
0
that made the hole script not work. A1exTatum 57 — 5y
0
it works but when i join. i want it to work when i touch a brick. A1exTatum 57 — 5y
0
Ok namespace25 594 — 5y
0
Change game.Players.PlayerAdded:Connect(function(plr) to script.Parent.Touched:Connect(function(hit) & Remove the chr added event and just use hit.Parent not chr namespace25 594 — 5y
Ad

Answer this question