Universal Script 📌
1.2k Views
562 Executions

Auto delete invisible barrier

Universal Script 📌
styear
styear100K executions
8 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Auto delete → deletes normal transparent parts Pass-through → transparent parts in Model/Folder can be walked through Ignore mesh → MeshPart / SpecialMesh not affected Auto detect → new parts in workspace are processed automatically

View Raw
local function setNoCollide(p)
	p.CanCollide=false
	p.CanTouch=false
	p.CanQuery=false
end

local function isMeshPart(p)
	return p:IsA("MeshPart") or p:FindFirstChildOfClass("SpecialMesh")
end

local function process(v)
	if v:IsA("BasePart") and not isMeshPart(v) then
		if v.Transparency>=1 then
			if v.Parent and (v.Parent:IsA("Model") or v.Parent:IsA("Folder")) then
				setNoCollide(v)
			else
				v:Destroy()
			end
		end
	end
end

for _,v in ipairs(workspace:GetDescendants()) do
	process(v)
end

workspace.DescendantAdded:Connect(process)


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
16.0k
93.4k
Bumped 47 minutes ago
Key System

Script hub

Kronos New

Universal Script 📌
48.5k
46.7k
Bumped 3 hours ago
Universal Script 📌
1.5k
1.3k
Bumped 6 hours ago
Universal Script 📌
4.2k
56.5k
Bumped 7 hours ago
Universal Script 📌
7.1k
71.8k
Bumped 7 hours ago
Script hub
3.5M
1.2M
Bumped 8 hours ago
Key System