roblox
Tutorial page
This article is an easy tutorial.
Scripting
This page is a tutorial about Scripting.

In this tutorial, we are going to make a sound effect for our game.

Required Instances

Scripting

We need two objects, a Script light iconScript dark iconScript and a Sound light iconSound dark iconSound, inserted into Workspace light iconWorkspace dark iconWorkspace. Sound objects contain members for managing sounds. There is a property called SoundId, which is the id of the sound that is being played. More information on Sound IDs can be found here. Now the sound is in the sound object, but it doesn't play. In order to make it play, open the script, and type the following code:

workspace.Sound:Play()

This will cause the sound to play, and stop, automatically. This can be used anywhere to give your game a neat sound effect.