Lesson 2 – TrailScript

Coding the Trail Script

Double click on the Script located inside the Trail to open it and begin coding. We will start on Line 1.

  1. Create a while true do loop on line 1.
  1. place a wait() function on line 2.
  1. Now set the Part Transparency to 1 to make it invisible.
  1. Set the CanCollide boolean value to false.
  1. The 5th line of code uses the player’s HumanoidRootPart to follow them around.
  1. The end code on line 6 puts an end to the while loop.

While True Do – The while—do loop evaluates if a condition is true or false. If true, the code between do and end executes and the true/false condition is reevaluated afterward.