Making a proximity prompt HoldDuration last longer if a value is "Rusty"

Basically what i want to make is a value that is “Rusty” which then makes a proximity prompt have its HoldDuration as 10, i’ve tried a lot of things but none have worked.

Can you show us what you’ve used? Because I’m slightly confused how it’s not working?

i’ve already deleted the scripts, sorry. tho i tried to create a new string value and a object value to be the name of a tool, “Rusty”. then i put a local script in the proximity prompt that should check if the value is “Rusty” and if it is it puts the holdduration on 10, though this didnt work.

Altering the HoldDuration property directly on the ProximityPrompt should be fine. It sounds like your scripts weren’t setting it properly.

If you’re sure it’s setting it, try doing it from the server instead of the client (which you probably should be doing anyway to be honest).

yeah but then wouldnt it affect other players aswell?

Do it locally using a localscript

If the tool itself is marked as rusty for everyone, then it would make sense for it to affect everyone, no? I might be misunderstanding your use case here though. It would help to explain why you want to do it for one specific player if the tool itself has a Value on it for everyone.

local Prompt = script.Parent
local Part = Prompt.Parent
local MaterialEvent = Part:GetPropertyChangedSignal("Material")

local function OnMaterialChanged()
	if Part.Material == Enum.Material.CorrodedMetal then
		Prompt.HoldDuration = 10 --When the part is rusty the prompt has a duration of 10 seconds.
	else
		Prompt.HoldDuration = 5 --When the part is not rusty the prompt has a duration of 5 seconds.
	end
end

MaterialEvent:Connect(OnMaterialChanged)

If I’ve understood you correctly I believe this is what you’re looking for.

Organisation:
image