My objective is to make an invisible script
for _, Part in pairs(Char:GetDescendants()) do
if Part:IsA("BasePart") or Part:IsA("MeshPart") then
Part.Transparency = 1
Char.Head.face.Transparency = 1
end
end
My objective is to make an invisible script
for _, Part in pairs(Char:GetDescendants()) do
if Part:IsA("BasePart") or Part:IsA("MeshPart") then
Part.Transparency = 1
Char.Head.face.Transparency = 1
end
end
If your script is for some reason not working, then you can try to call the parts by their table values (since the :GetDescendants() function creates a table) another way by changing your for-loop like so:
This should be in a LocalScript somewhere under StarterGui
local player = game.Players.LocalPlayer
local Char = player.Character
workspace.Baseplate.Touched:Connect(function()
local descendants = Char:GetDescendants()
for i = 1, #descendants do
if descendants[i]:IsA("BasePart") or descendants[i]:IsA("MeshPart") then
descendants[i].Transparency = 1
Char.Head.face.Transparency = 1
end
end
end)
On Line 4, you can edit the Event, and/or the name of the part that activates it.
That’s exactly what his Loop is doing, pairs provided the Index number and the Value accordingly
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
A Meshprt is a Basepart. What is the result of the code you posted??? One way to achieve what you’re trying to do would be to simply make an invisible character, place it in StarterCharaterScripts and name it StarterCharacter.
What’s actually wrong with it? To provide an answer tweaked towards this model, that information is relevant