How can i get all childrens from a folder and the one that got triggered by ProximityPrompt? [SOLVED]

  • Hello DevForum! I need help - How can I get all the children that are in the folder and get the Children from which the trigger(ProximityPrompt) was activated and then copy the Text Value from it?

RobloxStudioBeta_F35HgPTBwz

If all your interactables are made the same way in the explorer you can do something like this:

for _, interactable in ipairs(interactables:GetChildren()) do--looping through the children of the folder
      interactable.ProximityPrompt.Triggered:Connect(function()--when the proximity prompts are triggered do this
            YourGui.TheText.Text = interactable.Text.Value--make the text of the gui the text of the interactable
      end)
end
1 Like

Thanks! It worked.
Even with multiple parts!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.