Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a Proximity Prompt function?

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

1 comment

0

Any errors in the output?

1 answer

local prompt = script.Parent.ProximityPrompt
prompt.Triggered:Connect(function(player) --you can get the player who triggered w this param
	print(prompt)
end)

1 comment

0

How do I do this if I have multiple prompts?

This discussion is preserved as it was. New answers, comments, and votes are closed.