Events

An event is a data type that represents an action or occurrence within Roblox. You can connect functions called event handlers to call each time an event fires. For example, when a user's Character touches a Part, a Touched event fires. You can connect a function that does something in response to the event, such as hurt or heal the Character. Roblox programming is event-driven. Each script typically runs only once, so most game logic should be event-based.

Using Events

You can either connect a function to run code synchronously when it fires, or you can wait for an event to fire synchronously. See Using Events for instructions on working with events in Studio.

Roblox has many built-in events. Some commonly used ones include Players.PlayerAdded for when a user joins your experience, Player.CharacterAdded for when a user's Character spawns, and BasePart.Touched for when a part collides with another part. For information on the built-in events for each class, see the API reference.

Bindable Events and Functions

Roblox has many built-in events for each class on the API reference. To implement behavior that the built-in events don't support, create custom events using Bindable Events and Functions.

Remote Events and Functions

A client or server can't connect to BindableEvent instances that fire on the other side. To communicate across the client-server boundary, use Remote Events and Functions.