I can't figure out how to make the "CrouchAbility" change the transparency of the person who used it partially invisible (specifically 0.5) and anyone else looking at them completely invisible
"CrouchReciever" for the transparency to turn fully transparent
(Code is too long so Im gonna spread it out through messages)
local event = game.ReplicatedStorage:WaitForChild("CrouchAbility")
event.OnServerEvent:Connect(function(player)
local char = player.Character
if char then
local head = char:FindFirstChild("Head")
local faceClone = nil
if head then
local face = head:FindFirstChildOfClass("Decal")
if face then
faceClone = face:Clone()
face:Destroy()
end
end
local humanoid = char:FindFirstChildOfClass("Humanoid")
local originalDisplayDistanceType = nil
local originalNameDisplayDistance = nil
if humanoid then
originalDisplayDistanceType = humanoid.DisplayDistanceType
originalNameDisplayDistance = humanoid.NameDisplayDistance
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
end
for i,v in char:GetChildren() do
if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
v.Transparency = 1
end
end
for i,v in char:GetChildren() do
if v:IsA("Accessory") then
local handle = v:FindFirstChild("Handle")
if handle and handle:IsA("BasePart") then
handle.Transparency = 1
end
end
end
task.wait(10)