There does not appear to be any native component of the ProximityPrompt instance or ProximityPromptService that can enable your desired behaviour. Mind you, this is not an impossible feature, but it would require a good deal of effort to develop a wrapper that intercepts callbacks for remote invocation
I decided this would be a fun exercise, so I developed it for you. There is more than one script contributing to this wrapper’s functionality, so I’ve published it all to GitHub:
It’s largely seamless; you won’t be able to tell that it’s not a raw ProximityPrompt instance:
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Vendor = ReplicatedStorage.Vendor
local RemoteProximityPrompt = require(Vendor.RemoteProximityPrompt)
local ProximityPrompt = RemoteProximityPrompt(script.Parent)
local function onTriggered(player: Player)
print(`{player} triggered the ProximityPrompt!`)
end
ProximityPrompt.Triggered:Connect(onTriggered)
Except it comes with a new method:
And the RemoteProximityPrompt module allows you to invoke the ProximityPrompt anywhere:
You can only trigger ProximityPrompts who have been processed by RemoteProximityPrompt. At this stage, you can simply perform a search for all ProximityPrompts in the player’s immediate area, then attempt to trigger them.
I did my best to make this “perfect”, but I’m sure there are some edge cases I’ve yet to consider. I know for a fact I did not implement any protection against registering the same ProximityPrompt more than once, but I couldn’t be asked since it’s already 4:00 AM
I wouldn’t have assumed that this would enable @AriefYangArif’s desired behaviour. Appears to me as more of a cosmetic configuration. Despite that, I fear this solution isn’t as scalable. You would have to bombard the user’s screen with input options while also using making frequent modifications to or a setting a one-time absurd MaxActivationDistance value.
Nonetheless, I encourage OP to consider that approach, as mine undoubtedly suffers from overhead. Such is the blight of abstraction