Using Roblox services
With your programming experience so far, you have created scripts that are limited only to the functionality of built-in language features or the methods and events of instances. In Roblox, the use of services is necessary to add more complex behaviors and make use of additional events and methods that are needed within your experience. You can think of these services as libraries that are used to work with different aspects of your experience rather than specific data types.
Players service
Virtually every experience makes use of the Players service. The Players service is visible within the Explorer window and is where all player
instances are kept. The PlayerAdded
event is a very commonly needed event and is used to identify when a player joins an experience server. The following code prints the name of any player who joins the experience with a small message attached. Notice that the player who joins the experience is provided as a parameter to the...