Lesson · with Snap
Your First Script
Write Lua that makes a part spin forever. Then change one number and see what happens.
You need
- Roblox Studio
- A mouse is strongly recommended
Steps
Make a spinner
Insert a Part, anchor it and name it Spinner in Explorer.
Add a Script
Hover over Spinner in Explorer, click +, and choose Script.
Type the code
Replace the starter line with: while true do script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0.05, 0) task.wait() end
Change one thing
Change 0.05 to 0.2. Press Play. What changed? Now try moving 0.05 into the first slot.
Build task
Spinning hazard
Turn your spinner into an obstacle the player must time a jump around.
Finish line: A scripted part that moves when the game runs.