Skip to content

Script Recipes

Looking for working code examples? This collection of recipes shows you how to accomplish common scripting tasks in Second Life. Each recipe includes examples in both LSL and SLua.

Each recipe demonstrates a complete, working solution to a specific problem. You can:

  • Copy and paste the code directly into your scripts
  • Modify the examples to fit your specific needs
  • Learn patterns and techniques to apply elsewhere
  • Compare LSL and SLua approaches side-by-side

Basic Interactions

Touch detection, hover text, chat commands, and simple responses

Movement & Physics

Moving objects, following avatars, doors, vehicles, and physics simulation

Visual Effects

Particles, glow, transparency, color changes, and texture animation

Communication

Chat, instant messages, HTTP requests, and data exchange between scripts

Timers & Scheduling

Repeating actions, countdowns, scheduling, and time-based triggers

Data Storage

Saving data, notecards, databases, and persistent state

Avatar Interaction

Detecting avatars, permissions, animations, and attachments

Advanced Patterns

State machines, async operations, error handling, and optimization