Guest User

Untitled

a guest
Jan 31st, 2026
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local StartDialogueEvent = ReplicatedStorage:WaitForChild("StartDialogueEvent")
  3.  
  4. local function setupProximityPrompts()
  5. for _, descendant in pairs(workspace:GetDescendants()) do
  6. if descendant:IsA("ProximityPrompt") then
  7. local npcModel = descendant.Parent
  8. if npcModel:IsA("Model") and npcModel:FindFirstChild("Humanoid") then
  9. descendant.Triggered:Connect(function(player)
  10. StartDialogueEvent:FireClient(player, npcModel.Name)
  11. end)
  12. end
  13. end
  14. end
  15. end
  16.  
  17. setupProximityPrompts()
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment