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

How would I hide every proximity prompt in a place?

I've been working on a security camera system and I need every proximity prompt to be hidden when the cameras are being used. However I've been struggling. I've tried using a for loop however no look.

local function DisablePrompts(Parentt)
	for i = 1, #Parentt:GetChildren() do
		if Parentt:GetChildren()[i]:IsA("ProximityPrompt") then
			Parentt:GetChildren()[i].MaxActivationDistance = 0
		else
			DisablePrompts(Parentt:GetChildren()[i])
		end
	end
end

I hope someone has a solution. Thank you in advanced!

2 answers

✓ Accepted answer

Try Parentt:GetDescendants()

local function DisablePrompt(Parentt)
    for _, ProximityPrompt in ipairs(Parentt:GetDescendants()) do
       ProximityPrompt.Enabled = false
    end
end

1 comment

1

just incase you would want to do a check if its a ProximityPrompt

Can't you just use ProximityPrompt.Enabled = false?

1 comment

0

I'm trying to hide every instance of any proximity prompts in the entire place so sadly not.

This discussion is preserved as it was. New answers, comments, and votes are closed.