How do I connect the function if the player has been pressing prompt for enough time (not when the Triggered event occurs, but when a certain second is reached). I tried to do this, but I had problems with function disconnection if the player released the key before the “connect” was supposed to work
ProximityPrompts have a HoldDuration
property, which you can use to add a delay before the function connected to the prompt’s Triggered event runs:
Essentially, the default value of HoldDuration is 0, which means that the Triggered event is fired as soon as the player presses the prompt. If, for example, you change its value to 4, then the player will need to press the prompt for 4 seconds before Triggered is fired
If you store the RBXScriptConnection inside of a table, it would allow you to check if one already exists, thus preventing any issues with attempting to disconnect nil or duplicate connections
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.