Code Samples

The following samples show you how to carry out common scripting tasks in Roblox. Where applicable, corresponding 3D objects or models are provided. You can import the samples directly into your inventory where you can view them in the Studio Toolbox or open them directly in Studio.



Code Reservation Service

Demonstrates a system to reserve and hand out single-use codes.

Geofencing

Demonstrates a geofencing system to block content from users based on their region.

Play Smoke Puff

Plays a particle animation of a puff of smoke at the location, volume, and size of a given part.

Parallax Portal

Demonstrates a portal with a 'depth' effect achieved with parallaxing images.

Purchase Handling

This sample demonstrates an approach to safely and robustly awarding developer product purchases to players

Player Data

This sample demonstrates an approach to storing and accessing player data