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

How to make all parts and hats in a player transparent without writing a long line ?

Asked by
LeadRDRK 437 Moderation Voter
7 years ago

Trying to write a script that make the player transparent but it's just too long

0
You could try using for i,v in pairs (game.Players.LocalPlayer.Character) do then use IsA Kareem35 79 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

Paste the following script;-

for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if v.IsA("Accessory") then
wait()
v:FindFirstChild("Handle").Transparency = 1
end
end

--now for parts

for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if v.IsA("Part") then
wait()
v.Transparency = 1
end
end
Ad
Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

LocalScript inside of StarterCharacterScripts.

local player = game.Players.LocalPlayer
local character = player.Character

local function ghost(part)
    if part:IsA("BasePart") then 
        part.Transparency = 1;
    end
end

-- Invokes AFTER the for loop when something is added to character.
character.DescendantAdded:connect(function(part)
    ghost(part)
end)

-- Takes everything that is currently loaded in character and calls ghost
for i,v in pairs(character:GetChildren()) do 
    ghost(v)
end

Answer this question