How can I find all the proximity prompts under a model (DirtWall_Model)
local model = game.Workspace.DirtWall_Model
if model and model:IsA("Model") then
local proximityPrompts = {}
for _, part in ipairs(model:GetDescendants()) do
if part:IsA("ProximityPrompt") then
table.insert(proximityPrompts, part)
end
end
print("Found " .. #proximityPrompts .. " ProximityPrompts")
end
that works too. but if the reason is the lag in loading in of the proximity prompts, i’d personally use WaitForChild(), just in case it took longer than 5 seconds for other players.