Hiding ProximityPrompt from player who activates it

I have this system where a player can create a “Host match”, which another player can join by interacting with the proximity prompt.
However, it seems that the prompt shows up for the player who hosts it as well, which I don’t want.
image
(host view)

Is there a way I can hide this from the player that started the host match?

Code:

local function addProximityPrompt(player)
	local promptAttachment = Instance.new("Attachment")
	local prompt = Instance.new("ProximityPrompt")
	promptAttachment.Parent = player.Character.UpperTorso
	prompt.ActionText = "Join Match"
	prompt.ObjectText = player.Name
	prompt.RequiresLineOfSight = false
	prompt.Parent = promptAttachment
end

From a LocalScript just destroy the player’s own proximity prompt:

local Players = game:GetService("Players")
local client = Players.LocalPlayer

client.CharacterAdded:Connect(function(character: Model)
    character.DescendantAdded:Connect(function(descendant: Instance)
        if descendant:IsA("ProximityPrompt") then
            descendant:Destroy()
        end
    end)
end)

This will destroy new proximity prompts.

I tried that on a localscript, but it seems that it also destroys the prompt on the server side

What if you tried just disabling the prompt? I’m certain that there is an Enabled property for proximity prompts (I’m not 100% sure because I never used proximity prompts), so try setting it to false instead of destroying the prompt.

Looks like a replication thing.

Try creating the prompts client-sided instead:

local Players = game:GetService("Players")

local client = Players.LocalPlayer

local function addProximityPrompt(player)
	-- by the way it isn't necessary to parent a prompt to an attachment if you won't change the offset :p
	local promptAttachment = Instance.new("Attachment")
	local prompt = Instance.new("ProximityPrompt")
	promptAttachment.Parent = player.Character.UpperTorso
	prompt.ActionText = "Join Match"
	prompt.ObjectText = player.Name
	prompt.RequiresLineOfSight = false
	prompt.Parent = promptAttachment
end

Players.PlayerAdded:Connect(addProximityPrompt) -- add new prompts for new players

for _, player in ipairs(Players:GetPlayers()) do
	if player ~= client then
		addProximityPrompt(player)
	end
end

This actually worked out! I forgot that proximity prompts could be disabled like that lol

This is a bit off topic but I was wondering, what’s the purpose of the colon right after character and descendant?