TLDR: I failed at helping dont even try it. I gotta learn more lua
Ok so what you could do is call a remote event and pass through an object value as an argument.
So an example is
Stuff for server script note: you have to make this script a child of wanted proximity prompt
script.Parent.Triggered:Connect(function(plr)
local ev = game:GetService("ReplicatedStorage").MyRmEvent
local ObjVal = Instance.new("ObjectValue")
--adding the proximity prompt as the value of ObjVal
ObjVal.Value = script.Parent
ev:FireClient(plr, ObjVal)
)
local script for Gui
local event = game:GetService("ReplicatedStorage").MyRmEvent
event.OnClientEvent:Connect(function(prompt)
print(prompt.Name)
print("If above said the name of wanted prompt then i did it right!")
)
I apologize if this does not work. This is my first time working with lua in 2 months. I have been doing a lot of html and css recently.
local function onPromptTriggered(promptName)
--Do code depending on which prompt was triggered.
end
for _, prompt in ipairs(workspace:GetDescendants()) do
if prompt:IsA("ProximityPrompt") then
prompt.Touched:Connect(function()
onPromptTriggered(prompt.Name)
end)
end
end
You just need to give each prompt its own way so that it can be uniquely identified.