pesde goatsoft / lucy

Prompt

Replaces Roblox's default proximity prompt with a themed Lucy prompt that shows a rounded Kbd key cap inside a circular Progress hold ring, picks only the nearest prompt when several share an action, and can restyle existing ProximityPrompt instances across the whole game.

Prompt examplePrompt example
app.actions:define("gameplay", {
    interact = { Enum.KeyCode.E, Enum.KeyCode.ButtonX },
})

Lucy.Prompt.new({
    target = workspace.Booth.Console,
    action = "interact",
    actionText = "Play a set",
    objectText = "DJ Booth",
    distance = 10,
    hold = 0.6,
    onTrigger = function()
        boothSheet:open()
    end,
})

Actions and keys per device

When action names a Lucy action, the prompt's Kbd key cap reads app.actions:keys(action) and updates live if the player rebinds keys or switches between keyboard and controller.

On touch devices, Kbd shows "Hold" when hold > 0 or "Tap" (or your own touch label), and players can tap or hold the prompt pill directly on screen.

If you are not using app.actions, pass keyboard, gamepad and touch directly.

Hold to trigger

Set hold to the number of seconds the player must hold the key or press the prompt. A circular Progress ring wraps the rounded Kbd key cap and fills clockwise while holding. Letting go early or walking out of distance cancels the hold and resets the ring.

Nearest prompt

With exclusive = true (the default), when more than one prompt sharing the same action or key is inside its distance, only the nearest enabled prompt is active and responds to presses. Set showWhenInactive = true if farther prompts should stay visible and dimmed instead of hiding.

Variants and custom content

Prompt shares the same look options as Tooltip:

  • variant: default, inverse, primary, secondary, outline, destructive, overlay or registered via Lucy.Prompt.addVariant.
  • size: sm, md or lg.
  • border, fill, transparency, radius.
  • children or content: place extra badges, icons or counters in the prompt row.
Prompt examplePrompt example
Lucy.Stack.new({
    direction = "horizontal",
    gap = "Space3",
    wrap = true,
    children = {
        Lucy.Prompt.new({
            keyboard = Enum.KeyCode.E,
            actionText = "Queue",
            variant = "default",
        }),
        Lucy.Prompt.new({
            keyboard = Enum.KeyCode.G,
            actionText = "Dance",
            variant = "inverse",
        }),
        Lucy.Prompt.new({
            keyboard = Enum.KeyCode.F,
            actionText = "Change outfit",
            objectText = "Wardrobe",
            variant = "primary",
            children = { Lucy.Badge.new({ text = "VIP", variant = "secondary" }) },
        }),
    },
    Parent = parent,
})

Restyle existing ProximityPrompts

If your game already uses Roblox ProximityPrompt instances with server Triggered scripts, call Lucy.Prompt.restyle(app) once on the client. Every ProximityPrompt switches to Style = Custom and is drawn with Lucy whenever it shows:

Lucy.Prompt.restyle(app, {
    variant = "overlay",
    filter = function(raw)
        return not shouldHide(raw)
    end,
})

Pass an optional filter(raw) function to skip drawing specific prompts on the client (for example, hiding a vehicle's seat prompts while already seated) without changing raw.Enabled or raw.Style.

To restyle one prompt on its own, call local prompt, stop = Lucy.Prompt.restyleOne(app, proximityPrompt, options).

Props

PropTypeDefaultState keyWhat it does
targetBasePart, Attachment or ModelObject in the world to attach to
actionstring""yesAction name on app.actions
keyboardKeyCode or string""yesKeyboard key when action is empty
gamepadKeyCode or string""yesGamepad button when action is empty
touchstring""yesTouch label ("Hold" or "Tap" by default)
actionTextstring"Interact"yesMain verb shown in the prompt
objectTextstring""yesSmaller heading above actionText
distancenumber10yesActivation distance in studs
hysteresisnumber0.5Extra studs before leaving range
lineOfSightbooleanfalseRequire clear line of sight
holdnumber0yesSeconds to hold (0 for instant trigger)
exclusivebooleantrueOnly the nearest prompt per action is active
showWhenInactivebooleanfalseKeep inactive prompts visible and dimmed
enabledbooleantrueyesEnable or disable the prompt
sidestring"top"yestop, bottom, left or right
variantstring"default"yesdefault, inverse, primary, secondary, outline, destructive, overlay or registered
sizestring"md"yessm, md or lg
border, fill, transparency, radiusVisual overrides, same as Tooltip
children / contentExtra components inside the prompt row
onTriggerfunctionCalled with (prompt) when triggered
onHoldBeginfunctionCalled with (prompt) when holding starts
onHoldEndfunctionCalled with (prompt, completed) when holding stops

It also takes the props every component takes.

Methods, events and parts

  • prompt:trigger(), prompt:beginHold(), prompt:endHold(), prompt:check()
  • prompt.active(), prompt.inRange(), prompt.holding(), prompt.progress(): tracked getters
  • prompt.Triggered, prompt.HoldBegan, prompt.HoldEnded: signals
  • prompt.body, prompt.kbd, prompt.objectLabel, prompt.actionLabel, prompt.progressRing, prompt.progressBar, prompt.stroke

Preview

In Studio, from the command bar: Lucy.Preview.show("Prompt").