Hide Proximity Prompt From Player

Is it possible to hide a proximity prompt from a individual player?

Remove it by local script, thats all.

Yes, you need to go through the player, then disable it accordingly.

Once they have triggered it?

local prompt = script.Parent

prompt.Triggered:Connect(function(player)
	--do code
	script.Parent:Destroy()
end)

try this

local ProximityPrompt  = script.Parent

game.Players.PlayerAdded:Connect(function(player)
   if player.Name == " " then --Player Name here
       ProximityPrompt.Triggered:Connect(functio()
           -- Code here

     end
   end
end)

I want to hide it from the player that has triggered it until they’ve completed an action and then re-enable it because it gets in the way.

1 Like
local Triggered = false
local ProximityPrompt = script.Parent

game.Players.PlayerAdded:Connect(function(Player)
    ProximityPrompt.Triggered:Connect(function()
        if Triggered ~= true then
            Triggered = true
                 ProximityPrompt.Enabled = false
            repeat task.wait(1) until _CodeHere -- Put the code you want there that tells the system if the player met the condition. If the player hasn't meant that condition, it will keep waiting 1 second.
                ProximityPrompt.Enabled = true
            if Triggered == true then
                -- Do whatever you want to happen if the proximity prompt was triggered prior to them doing the task (condition) that needed to be done before.
            end
        end
    end
end)

This should work, if it’s not what you need let me know!

1 Like

I’ll give that a shot!

I should probably also say I’d still like that proximity prompt to be visible/useable to other players, just not the ones currently performing the action.

So that’d actually be a whole new topic you need to create.

You can make a remote event for this, for example:

Prompt script – (Prompt)

local remote = game.ReplicatedStorage(“Hide”)

script.Parent.Triggered:Connect(function(plr)
remote:FireClient(plr, script.Parent)
end)

Event script – (StaterPlayerScripts)

local remote = game.ReplicatedStorage(“Hide”)
local plr = game.Players.LocalPlayer

remote.OnClientEvent:Connect(function(prompt)
prompt.Enabled = false
end)

I might be posting this comment long after the question, but it might end up helping someone who is searching for this.

3 Likes