Build NPC Dialogue and Hold Prompts
Show readable dialogue and progress indicators around Roblox's built-in interaction prompts.
Put dialogue on the prompt
Create a ProximityPrompt on each NPC. Put the dialogue text in a string attribute on that prompt. A LocalScript can listen for the local player's activation and update the same dismissible panel for each NPC. Keep dialogue short and test that ordinary prompts without the attribute are ignored.
Show progress without awarding anything
Set HoldDuration above zero when an interaction should take time. Display a bar from the moment holding begins and advance it based on elapsed time. Hide it on release, completion or when the prompt becomes hidden. Treat the bar as feedback and let the prompt's server handler decide the result.
Check keyboard and touch
Test beginning an interaction, walking out of range and returning. Try the phone preview and verify that the panel can be dismissed without blocking the next prompt. Change text size before shrinking the whole panel.
Put one prompt in a place people can reach
Create an NPC or a stand-in model in a simple room. Add a ProximityPrompt to a visible part or attachment and set its action text to Talk, then walk to it with a player. Adjust the activation distance so the prompt becomes readable before the player collides with the counter. Try entering from an angle and from behind a wall. If the prompt appears where players cannot actually use the interaction, change its line-of-sight setting or move its attachment. Add a string attribute named DialogueText to this prompt. That lets your LocalScript distinguish a conversation from ordinary interactions elsewhere in the room.
Reuse one panel for several characters
Create the dialogue GUI once for the current player. When they activate a prompt with text, copy the text into the panel and make it visible. The same panel can handle a shopkeeper, guide and librarian without duplicating the interface. Use one clear close control and give the text enough room to wrap in a phone viewport. Consider what happens if someone activates a different conversation while the panel is already open. Replacing the text is simpler than stacking smaller windows. A conversation that triggers an item purchase or quest action needs its own server validation. The panel only explains what the player can do.
Calculate a hold meter from elapsed time
Set a HoldDuration of around one second on a separate prompt such as Open Chest. When the player begins holding, store the prompt and the time. Each local update can divide elapsed time by the configured duration and clamp the fraction between zero and one. That gives the fill width a clear meaning. Clear the panel if the player releases early, if the prompt is hidden or if it completes. In particular, if the player backs away while holding, there should be no old meter stuck on the screen. A missing cleanup can look like a server problem even though the next interaction would still work.
local fraction = math.clamp((os.clock() - began) / prompt.HoldDuration, 0, 1)
fill.Size = UDim2.fromScale(fraction, 1)
Keep visual feedback separate from the result
Use the built-in prompt activation event for the server action. A visual meter can reach its far end even if the player walks out of range exactly as the input completes. If your own game logic decides eligibility, have that logic check the current player and interaction state. The HUD can indicate that the player is still holding or show a result after the action is approved. It should not award items on its own. For a chest prototype, show a simple completion message first. Only add inventory rewards after you can reliably reproduce a success, an early release and an attempt from outside the usable distance.
Test controller input and small screens
Hold for half the required time, release and immediately try a different prompt. Its meter should start from empty. Complete the hold with the keyboard, then try the phone preview and a controller if your game supports one. Check that the tap target for closing the dialogue does not overlap Roblox's prompt or movement controls. Increase font size or shorten the lines if the panel is difficult to read. For several conversations in a row, close the panel and verify you can reopen the same one without rejoining. These tests are easy to repeat when one prompt carries text and another is reserved for holding.