Advertisement
ProScripter29

ClickDetectors and ProximityPrompts

Jun 4th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. local FolderToScan = workspace
  2.  
  3. --[[
  4.  
  5. 1 - "fireclickdetector"
  6. 2 - "fireproximityprompt"
  7.  
  8. ]]--
  9.  
  10. local FireMode = 1
  11.  
  12. local Functions = {
  13. [1] = function(v)
  14. fireclickdetector(v, 0)
  15. end,
  16.  
  17. [2] = function(v)
  18. fireproximityprompt(v)
  19. end,
  20. }
  21.  
  22. local InstanceName = "ClickDetector"
  23.  
  24. for i, Inst in pairs(FolderToScan:GetDescendants()) do
  25. if Inst:IsA("ClickDetector") and FireMode == 1 then
  26. Functions[1](Inst)
  27. elseif Inst:IsA("ProximityPrompt") and FireMode == 2 then
  28. Functions[2](Inst)
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement