I’m attempting to make an NPC system which will flash a ProximityPrompt whenever you’re in suitable range to talk to the NPC.
The problem I’m having is that whenever I use a script to create a ProximityPrompt and distribute it to the NPCS with the “NPC” tag, the object is created and is placed where it’s programmed to be but the proximity prompt does not visually appear whenever I’m in range of the prompt part.
Script:
local CollectionService = game:GetService("CollectionService")
local NPCS = CollectionService:GetTagged("NPC")
for _, npc in pairs(NPCS) do
local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Talk"
prompt.Parent = npc.Parent:FindFirstChild("PromptPart")
end
What’s the problem here?