Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I hide every proximity prompt in a place?

Asked by 2 years ago

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.

1local function DisablePrompts(Parentt)
2    for i = 1, #Parentt:GetChildren() do
3        if Parentt:GetChildren()[i]:IsA("ProximityPrompt") then
4            Parentt:GetChildren()[i].MaxActivationDistance = 0
5        else
6            DisablePrompts(Parentt:GetChildren()[i])
7        end
8    end
9end

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

2 answers

Log in to vote
0
Answered by
Voruel 41
2 years ago

Try Parentt:GetDescendants()

1local function DisablePrompt(Parentt)
2    for _, ProximityPrompt in ipairs(Parentt:GetDescendants()) do
3       ProximityPrompt.Enabled = false
4    end
5end
1
just incase you would want to do a check if its a ProximityPrompt Puppynniko 1059 — 2y
Ad
Log in to vote
0
Answered by
Xeqro 20
2 years ago

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

0
I'm trying to hide every instance of any proximity prompts in the entire place so sadly not. Glitxhxd 6 — 2y

Answer this question