I am trying to disable proximityprompts so that players cant activate them while still keeping them visible. Does anyone know if this is possible or how to do this? I have tried setting the hold duration to super high values but then players cant see the message on the prompts if they start pressing the button.
i guess you could set the hold duration to 0 and just disable the script?
local prompt = script.Parent
local used = false
prompt.Triggered:Connect(function(player)
if used then return end
used = true
prompt.HoldDuration = 0
--Do code here.
end)
As suggested you could set the hold duration to 0. Other than that, you’d just need a toggle which disables the prompt once it has been used. If you need the “used” state to be player specific (such that each user can trigger the prompt once), you can use a table value instead to handle which players have/haven’t triggered the prompt.
local prompt = script.Parent
local usedPlayers = {}
prompt.Triggered:Connect(function(player)
if usedPlayers[player] then return end
usedPlayers[player] = true
--Do code here.
end)