Proximity prompt question

I was wondering, when I use proximityPromptservice.PromptTriggered on the client, do I have to check if playerWhoTriggered == player? This probably doesn’t matter but I’m just curious.

local ProximityPromptService = game:GetService("ProximityPromptService")
local player = game.Players.LocalPlayer


ProximityPromptService.PromptTriggered:Connect(function(prompt, playerWhoTriggered)
    if playerWhoTriggered == player then
        
    end

end)
1 Like

When a player activates a proximity prompt, the information doesn’t get sent to other players (only to the server). Subsequently, playerWhoTriggered will always be the local player, when the code is a local script. This means that you don’t need to check if playerWhoTriggered == player

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.