Script library

Roblox UI Systems Scripts

Explore Roblox UI Systems Scripts, including NPC Dialogue Panel from Interaction Prompts and Personal Flashlight That Survives Resets. Read the Luau source and installation details for each script.

NPC Dialogue Panel from Interaction Prompts

Place a ProximityPrompt on your shopkeeper and add a string attribute named DialogueText to that prompt. This LocalScript shows a small, dismissible dialogue panel on the player's screen whenever they activate a prompt with that attribute. You can reuse the same panel for any number of NPCs. Keep each message short enough for phone screens and test that unrelated prompts remain silent.

Personal Flashlight That Survives Resets

This LocalScript adds a Flashlight action to your own cave or night map. Press F or tap the action button to toggle a SpotLight on the current character's head. It recreates the light after a character reset and starts turned off. Tune Angle, Brightness and Range to keep paths readable without lighting the entire room. Try it once on mobile emulation as well as with a keyboard.

Low-Intensity Camera Shake Module

Use this ModuleScript from a LocalScript for a brief landing or puzzle-completion camera cue. Call Start with a strength and duration to apply small, decaying positional offsets after the default camera update. Stop releases the render update immediately and clears its last offset. Begin with a strength near 0.25 and pair it with a reduced-motion option in your game.

Camera Zoom Zone with Smooth Reset

Create an anchored, invisible ZoomZone part. This LocalScript checks whether your player is inside the zone and tweens the current camera field of view to 52, then restores its starting value on exit. The zone can be rotated in Studio. Preview it near doors and ramps to avoid abrupt changes in readability, particularly when your character enters from above.

Minimap Position Marker for Square Maps

Add an anchored part called MapBounds centered on your playable area, with X and Z size covering the map. This LocalScript draws a small square radar and moves its dot according to your avatar's position inside those bounds. It supports a rotated bounds part and clamps the dot at the border. Add a map image under the dot once your world layout is stable.

Notification Queue with One Toast at a Time

Require this ModuleScript from a LocalScript and pass an existing TextLabel to New. Call Push on the returned object whenever you want a brief notification. The queue displays one message for two seconds at a time and keeps up to eight pending messages. Send a rapid burst during testing to check ordering before using it with checkpoints or inventory changes.

Health Bar for New and Returning Characters

Put this LocalScript into StarterPlayerScripts to show a compact health bar outside combat menus. It rebinds to the new Humanoid when the character resets, updates when Health or MaxHealth changes, and shifts from red to green as health rises. Test with a hazard and a healing station, then customize its position to avoid overlapping your other HUD elements.

Slide-Out Menu with Reversible Animation

Inside a ScreenGui, create a Frame named MenuPanel and a TextButton named MenuToggle. Add this LocalScript alongside them. The button moves the panel between the position set in Studio and a point offscreen, canceling the old tween when clicked mid-animation. Keep the menu toggle outside the sliding panel and check narrow screen sizes before choosing the open position.

Hold-to-Interact Progress Meter

Give a ProximityPrompt a HoldDuration greater than zero, then install this LocalScript to display a progress bar when the player starts holding its control. The bar grows from empty using the prompt duration and disappears on completion or release. The prompt still owns the interaction. Test holding halfway and walking away, then compare the keyboard and touch controls.

Inventory Slot Hotbar with Touch Buttons

This LocalScript draws a four-slot hotbar and keeps the selected slot in a local attribute. Click or tap a slot, or press number keys 1 through 4, to update the highlight. It is the selection layer for your own inventory system. Connect gameplay to a server-validated item action and confirm that typing into chat never changes the selected slot.

Character Color Picker with World Swatches

Set three anchored swatch parts under Workspace.ColorSwatches to your chosen colors. Approaching a swatch lets a player apply its color to the torso of their current avatar. The server reads the chosen color from the part itself. This is a simple dressing-room interaction for your own game. Test both R6 and R15 avatars and adjust clothing if it obscures the color change.

Music Toggle Button with Volume Restore

Place a Sound named LobbyMusic in SoundService and add this LocalScript inside a TextButton. The button mutes the music for the current player without restarting the track and restores its starting volume when unmuted. Use it for a soundtrack preference separate from effects. Set the sound to loop if appropriate and test switching several times while the music is playing.

Zone Entry Notification for Adventure Maps

Add transparent, anchored zone parts inside Workspace.MapZones and name them with the labels you want to display. The client checks which part contains the player and briefly shows the name when they enter a different zone. Alphabetical order decides overlapping zones. Walk the zone boundary several times during a playtest before placing two notices directly beside each other.

Button Press Animation with UIScale

Add this LocalScript inside an ImageButton or TextButton. It inserts a UIScale if needed, shrinks the button when pressed, and returns it to its original scale with a short easing tween. Rapid changes cancel the previous tween, and tapping also triggers a short press. Attach your gameplay handler separately and test the animation with keyboard, mouse and touch.