Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Proximity Prompt function?

Asked by
mewtify 26
3 years ago
Edited 3 years ago

Hey, I have recently discovered Proximity Prompts and wanted to replace all mouse clicks in my game just so it is more clear in the game. I know how to work click detectors pretty well, but I'm new to proximity prompts so I would appreciate some help.

Here's an example of my code -

function onMouseClick()
    print("Hello World!")
end

clickDetector.MouseClick:connect(onMouseClick)

That works fine with my click detector. But if I replace Mouseclick with Triggered, it does not work. (assuming I also change the "clickDetector" to a proximity prompt rather than a click detector)

Hopefully this explains what I am trying to do, and I apologize if this is a dumb question, I am quite new to coding in general. Thank you so much

0
Any errors in the output? MarkedTomato 810 — 3y

1 answer

Log in to vote
0
Answered by
l_diue 30
3 years ago
local prompt = script.Parent.ProximityPrompt
prompt.Triggered:Connect(function(player) --you can get the player who triggered w this param
    print(prompt)
end)
0
How do I do this if I have multiple prompts? mewtify 26 — 3y
Ad

Answer this question