When I begin to make the character invisible, it goes completely invisible like i want it to, but when it comes back to become visible again, it leaves the rest of your body besides your head a torso at .05 transparency, Why?.
In the GIF you can see that everything but the head and hat are semi transparent (.05 transparency to be exact)
Here is some of the code:
--This is the LocalScript that detects when you press the button K
if workspace:FindFirstChild(player.Name..'Mark') == nil then
local ws = player.Character.Humanoid.WalkSpeed
local jp = player.Character.Humanoid.JumpPower
CanCast = false
player.Character.Humanoid.WalkSpeed = 0
player.Character.Humanoid.JumpPower = 0
sound:FireServer('FXTarg',0, player)
sound:FireServer('Mark', 0, player)
sound:FireServer('Sound', player.Character.Head)
sound:FireServer('Invis') --The event that makes u turn invisible
wait(2)
player.Character.Humanoid.WalkSpeed = ws
player.Character.Humanoid.JumpPower = jp
sound:FireServer('Warp', 0, player)
--sound:FireServer('lol')
wait(COOLDOWN)
CanCast = true
end
--The part that runs when the Invis event is triggered
elseif task == 'Invis' then
local parts = plr.Character:GetChildren()
local fadeable = true
while fadeable do
wait(.05)
print('Running')
for i,v in pairs(parts) do
if v.Name ~= 'HumanoidRootPart' and v.ClassName == 'Part' and v.Transparency < 1 then
v.Transparency = v.Transparency +.05
elseif v.ClassName == 'Hat' then
v.Handle.Transparency = v.Handle.Transparency +.05
elseif v.Name ~= 'HumanoidRootPart' and v.ClassName == 'Part' and v.Transparency >= 1 then
print('broke fade')
print(v)
fadeable = false
wait(2)
local partz = plr.Character:GetChildren()
local fadeablez = true
while fadeablez do
wait(.05)
print('running')
for i,v in pairs(partz) do
if v.Name ~= 'HumanoidRootPart' and v.ClassName == 'Part' and v.Transparency > -0 then
v.Transparency = v.Transparency -.05
elseif v.ClassName == 'Hat' then
v.Handle.Transparency = v.Handle.Transparency -.05
elseif v.Name ~= 'HumanoidRootPart' and v.ClassName == 'Part' and v.Transparency <= -0 then
print('broke unfade')
fadeablez = false
break
end
end
end

1 comment
The reason why i am using remote events is because the game has FilteringEnabled set to true.