Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make an invisible script? I've tried but am not sure.

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

2 comments

0

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.

0

What’s actually wrong with it? To provide an answer tweaked towards this model, that information is relevant

1 answer

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.

1 comment

0

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.