How To Make a Follow Script
Introduction
This tutorial will show you how to make a part follow another part. It will be using RocketPropulsion.
How to Add RocketPropulsion
You need to be in Roblox Studio. Make sure you are, and follow these steps:
The Scripting Involved
Scripting will allow you to have more control over the RocketPropulsion object.
If you are in Roblox Studio,
- In the Explorer, select Workspace.
- Go to Insert, then Object.
- In the following window, find Script and press OK.
- Find the script, and double click to open the script writer.
- Copy and paste the following into this script window:
local RP = Instance.new("RocketPropulsion") --Inserts RocketPropulsion RP.Parent = workspace.Part --Moves object to Part RP.MaxSpeed = 45 --45 is the set speed RP.Target = workspace.Target --What it will follow RP:fire() --Moves towards set target wait(5) --Waits 5 seconds RP:abort() --Stops the RocketPropulsion
Now, click the Close button to exit from the script window.
In order to run the script, click on the Play button. Save your place first!