Download ArticleDownload Article

Roblox is an online gaming platform that allows user to create, share, and play games online with other Roblox players. Building things in Roblox Studio is a lot of fun. However, if you want to make a game, you need to learn how to script. This How.com.vn teaches you how to script in Roblox.

Part 1
Part 1 of 2:

Getting Started

Download Article
  1. How.com.vn English: Step 1 Understand what a script is.
    Scripts are lines of code that contain instructions for a game or program to follow. In Roblox, scripts can be used to do everything from giving (or taking away) a player's health points, making objects move, or anything you can think of. Roblox uses a programming language called Lua. In Roblox, there are three types of scripts, which are as follows:[1]
    • Server Script: A server script is a script that is stored on the server. A server script creates actions in a game that can be seen by all players.
    • Local Script: A local script is a script that is specific to a single player. A local script creates actions that can be seen by one player only.
    • Module Script: A module script contains frequently used script functions that can be used by other scripts. This is a good way to organize frequently used code so that you don't have to copy and paste or reuse the same code in multiple scripts.
  2. How.com.vn English: Step 2 Open Roblox Studio.
    Roblox Studio has an icon that resembles a blue square. Click the Roblox Studio icon on your desktop, Windows Start menu, or Applications folder on Mac.
    Advertisement
  3. How.com.vn English: Step 3 Click View.
    It's in the menu bar at the top. This displays a panel of windows you can open in Roblox Studio.
  4. How.com.vn English: Step 4 Click Output.
    It's in the View panel at the top of the screen. This opens the Output window. The Output window allows you to view your script in action and see any error messages your script creates.
  5. How.com.vn English: Step 5 Click Explorer.
    It's in the upper-left corner of the View menu. This opens the Explorer window. You can use the Explorer menu to browse objects in your game and add new objects.
  6. Step 6 Click "Workspace" in the Explorer window.
    To view its contents, click the arrow icon next to "Workspace".
  7. Step 7 Click + next to "Workspace".
    This displays a pop-up menu with the different scripts and various instances you can add to the Workspace.
  8. How.com.vn English: Step 8 Click Script.
    It's next to an icon that resembles a blue page. This creates a new server script with a print function, with the message "Hello World!".
    • You can also find the options to create a new local script and a new module script in the upper-right corner.
    • Try changing the text in quotation marks. The "print" function is used to display text in the Output window.
  9. How.com.vn English: Step 9 Give the script a name.
    To give the script a name, click the name of the script below "Script" in the Explorer menu. Then type the name you want to give it.
  10. How.com.vn English: Studio Play Button.png
    10
    Run your script. Press the "Play" button at the top of the Roblox Studio window. If you see your message in the output window, then congratulations! You have written your first script!
  11. Advertisement
Part 2
Part 2 of 2:

Start Practicing

Download Article
  1. How.com.vn English: Studio Toolbox Button.png
    1
    Open the toolbox. Navigate to the "VIEW" tab at the top of the Roblox Studio window. Next, select the "Toolbox" button.
  2. How.com.vn English: Studio Plugins Button.png
    2
    Select Plugins. Open the dropdown menu and select "Plugins". This will allow for us to search for a resource, which will help us learn how to script on the platform.
  3. How.com.vn English: Studio Plugin Search.png
    3
    Install ScriptMate. Search for "ScriptMate", select it, and install it to Roblox Studio.
  4. How.com.vn English: Studio Open Plugin.png
    4
    Open ScriptMate. Navigate to the "PLUGINS" tab, and open the ScriptMate plugin.
  5. How.com.vn English: Studio Plugin Allow.png
    5
    Give plugin permissions. Select "Allow" to any windows that initially appear. This allows for the plugin to grab the latest educational information, and read your solutions to scripting exercises.
  6. How.com.vn English: Studio Plugin Menu.png
    6
    Select the episode. Select "Episode 1" to begin learning how to script on Roblox.
  7. How.com.vn English: Studio Script.png
    7
    Start learning & practicing. Watch the tutorial video linked in the script. Once you have finished, start solving the scripting challenges and continue the tutorial content.
  8. Advertisement



Community Q&A

Search
Add New Question
  • Question
    Can I type capital letters in scripts?
    How.com.vn English: Community Answer
    Community Answer
    Yes, but only if it is needed to make it right. Here is an example to show you: player.Name
  • Question
    How do I make a script that will make a model talk and answer questions?
    How.com.vn English: Community Answer
    Community Answer
    Most people use the dialogue elements that can be entered by right-clicking the object in the explorer, clicking the "Insert Object" button, and finding dialogue. It doesn't require scripting.
  • Question
    How do parents and child work in scripts?
    How.com.vn English: Destinid10_2
    Destinid10_2
    Community Answer
    They are easy to understand and apply. You can use .Parent to reference to the Parent of a item. For example: local part = script.Parent. Another practical example: local workspace = Part.Parent. For referencing Childs is a little more complex, because .Child doesn't exist. So I recommend you that when you're going to reference a Child, use basic referencing code, for example, like this: local part = game.Workspace.Part.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Travis Boylls
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for How.com.vn. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 113,456 times.
      45 votes - 61%
      Co-authors: 30
      Updated: May 1, 2023
      Views: 113,456
      Categories: Roblox
      Article SummaryX

      1. Open Roblox Studio.
      2. Insert a new block and name it "Deathblock".
      3. Right-click the deathblock and click Insert Object.
      4. Insert a new script.
      5. Write "function onTouch(Deathblock)" on the first line.
      6. Write "local humanoid = Deathblock.Parent:FindFirstChild("Humanoid")" on the next line.
      7. Write "if (humanoid ~= nil) then" on the next line.
      8. Write "humanoid.Health = 0" on the next line.
      9. Write "end" on the next line.
      10. Write "end" again on the next line.
      11. Write "script.Parent.Touched:connect(onTouch)" on the last line.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 113,456 times.

      Did this article help you?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement