It's the best practice to name the function with the pattern onEventName to help you find the function in the future. For example, the BasePart.Touched event passes the object that touched the Part, and the Players.PlayerAdded event passes the Player that joined your experience. Most events pass arguments to their connected functions when they fire. You can connect a function to an event using Connect() to execute code each time the event fires. Most built-in events are synchronous, so you canĬonnect a function for following custom behaviors in response a certain built-inĮvent by scripting. Player.Character touching a Part automatically fires aīasePart.Touched event. Respond to specific actions or changes related to those objects. Many objects have built-in events provided by their APIs that automatically Additionaly, you can use networking events that allow event-driven communication across the client-server boundary. You can also create custom events that you fire and respond to. When implementing your logic, you can connect functions to built-in events fired by the engine to respond to them. The engine supports multiple types of events. Scripting on Roblox is primarily event-driven.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |