PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Creating a Tool Trail

Creating a Tool Trail

Prerequisites
  • General knowledge of Studio covered in Intro to Studio
  • Knowledge of scripting covered in Coding 2
  • Students should have completed Adventure Game - Upgrades
  • Lesson Time 10 - 20 minutes
    Optional Handouts
  • Game Reference Document
  • Learning Objectives
  • Apply knowledge of ethical entrepreneurship to make money by offering players an in-game purchase
  • Create a trail effect that is attached to a player's tool
  • Game developers often give players the chance to purchase special abilities, avatar items, and even bonus content in exchange for Robux. This is a great way for developers to earn Robux that can be exchanged for real life money and for players to get fun bonuses they wouldn’t have otherwise.

    Creating extra content for players to purchase is called monetization. One way developers monetize their game is by creating special one-time purchases such as bonus content, a tool, or a new look for an in-game item. In this case, players will have the option to purchase a special effect for their tool.

    Ethical Entrepreneurship

    Monetizing games can be a way fun of earning money, but it can easily become frustrating for players if developers don’t follow ethical guidelines.

    Ethical Entrepreneurship should:

    • Not take advantage of players by forcing them to pay money to win. Every player should be able to have fun without paying Robux.
    • Give players well-made content for a fair price.
    • Show players exactly what they’re purchasing. Players shouldn’t be surprised about what they buy.

    The Developer Exchange Program allows students to convert Robux into real-world money. In order to cash out, you must have an active Outrageous Builders Club membership and be at least 13. To see the full set of guidelines, visit the Developer Exchange FAQs .


    Creating a Trail on the Tool

    As mentioned before, a great way to monetize a game is by letting players change the appearance of in-game items. In this case, players will be able to purchase trail effect on their tools.

    Other Uses for Trails

    Trails are a great way to show motion. For example, you can add a trail to a fast moving enemy or give a trail to a player with a speed boost powerup.


    Move the Tool to the Workspace

    Right now the tool is in the StarterPack, making it invisible in the game editor view. You’ll need to place the tool in the Workspace temporarily while working on the trail.

    1. Under the Explorer, In StarterPack, right-click on Spoon and select Copy.
    1. So you can see the tool in the game editor, scroll-up in the Explorer and right-click on Workspace. Select Paste Into to put the tool into the Workspace.
    1. Make it easier to test by moving the tool near the spawn location.
    Be Careful Moving the Spoon

    When moving the tool, make sure you click and move the spoon object so you move everything along with it. If you just move Handle, you’ll only be moving the handle portion of your tool.


    1. Delete the original tool in StarterPack so that you don’t accidentally make changes to the wrong tool.

    Create Attachments for the Trail

    To create a trail, you’ll need two objects called attachments that mark the start and end of the trail.

    1. In the Model Tab, click on the arrow under Create and select Attachment. Create two attachments by clicking on the top and bottom of the spoon.
    1. To stop adding attachments, press Esc on your keyboard.
    2. Rename your attachments to be Top, the start of your trail, and Bottom, the end. Naming these will help you connect them to the Trail easier later.
    Attachments Might Be In Different Places

    Depending on where you clicked to create an attachment, it may or may not be in the same place as the picture above.


    1. In the Spoon, add a new Trail.
    Don't Test Your Trail Yet

    While you do have a trail, it won’t show up when you test. This is because the attachments aren’t connected to the trail. You’ll connect them in the next step, telling the trail where to start and each the effect.


    Connect Attachments to the Trail

    The trail will be connected to the spoon at the top and bottom attachments that were created.

    1. In the Explorer, under Spoon, select the trail.
    1. In the Properties, scroll-down to Data and find Attachment0 and Attachment1. These need to be connected to the attachments on the tool.
    2. Click the box next to Attachment0 and then in the Explorer, click Top. Repeat this step to connect Attachment1 to Bottom.
    1. Test the game, the spoon should leave a trail as the player moves.
    Testing Now Gives a Specific Error

    At this point, you’ll get an error in the ToolScript reading "Workspace.Spoon.ToolScript:8: attempt to index local 'playerStats' (a nil value)" This is because the Tool isn’t in the StarterPack at the moment. It’ll be fixed once you move the tool back to StarterPack.


    Move the Tool Back to StarterPack

    Since you don’t need to see the Tool anymore, move it back into the StarterPack.

    1. In the Workspace, right-click Spoon and select Copy.
    1. Right-click on StarterPack and select Paste Into.
    1. Delete the Spoon in the Workspace so you don’t have a duplicate.
    1. Test that players get a tool at the start of the game.

    Turn Off The Trail Effect

    When players start the game, the trail should be turned off unless they’ve purchased it.

    1. Select the tool’s trail. In Properties, scroll-down to Emission, and un-check Enabled. This will turn the trail off by default.
    1. Test the game. The trail should be off.

    Now that you have the trail effect created, you’ll need to create a game pass. This game pass will let players buy your trail effect in-game.


    These documents are licensed by Roblox Corporation under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Roblox, Powering Imagination, and Robux are trademarks of Roblox Corporation, registered in the United States and other countries.