|
| 17 Mar 2013 11:30 AM |
I have been trying to make a brick that moves forwards and backwards using CFrame, with the while true do command. I'm new to scripting, how should I do this? |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2013 11:32 AM |
local p = game.Workspace.Part while true do p.Position = Vector3.new(120, 4, 120) wait(1) p.Position = Vector3.new(125, 4, 120) wait(1) end |
|
|
| Report Abuse |
|
|
| |
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 17 Mar 2013 11:55 AM |
That won't do what you asked. This is what you've asked for:
local p = script.Parent local offSetX, offSetY, offSetZ = 1,0,0 local waitTime = 0.1
while true do p.CFrame = p.CFrame + CFrame.new(offSetX, offSetY, offSetZ) wait(waitTime) p.CFrame = p.CFrame - CFrame.new(offSetX, offSetY, offSetZ) wait(waitTime) end
Oh, and, reported for spam. |
|
|
| Report Abuse |
|
|
| |
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 17 Mar 2013 11:58 AM |
It's a signature.
Oh, and, reported for spam. |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2013 01:23 PM |
| @2 Above, how should I set this up to work within a brick? Do I just paste the script into the brick, or is there more? .-. |
|
|
| Report Abuse |
|
|