Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local StartDialogueEvent = ReplicatedStorage:WaitForChild("StartDialogueEvent")
- local function setupProximityPrompts()
- for _, descendant in pairs(workspace:GetDescendants()) do
- if descendant:IsA("ProximityPrompt") then
- local npcModel = descendant.Parent
- if npcModel:IsA("Model") and npcModel:FindFirstChild("Humanoid") then
- descendant.Triggered:Connect(function(player)
- StartDialogueEvent:FireClient(player, npcModel.Name)
- end)
- end
- end
- end
- end
- setupProximityPrompts()
Advertisement
Add Comment
Please, Sign In to add comment