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
8 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 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Paste the following script;-

01for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
02if v.IsA("Accessory") then
03wait()
04v:FindFirstChild("Handle").Transparency = 1
05end
06end
07 
08--now for parts
09 
10for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
11if v.IsA("Part") then
12wait()
13v.Transparency = 1
14end
15end
Ad
Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
8 years ago
Edited 8 years ago

LocalScript inside of StarterCharacterScripts.

01local player = game.Players.LocalPlayer
02local character = player.Character
03 
04local function ghost(part)
05    if part:IsA("BasePart") then
06        part.Transparency = 1;
07    end
08end
09 
10-- Invokes AFTER the for loop when something is added to character.
11character.DescendantAdded:connect(function(part)
12    ghost(part)
13end)
14 
15-- Takes everything that is currently loaded in character and calls ghost
16for i,v in pairs(character:GetChildren()) do
17    ghost(v)
18end

Answer this question