generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help Request - while true do

Previous Thread :: Next Thread 
ninjoe2012 is not online. ninjoe2012
Joined: 11 Mar 2012
Total Posts: 2143
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
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
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
ninjoe2012 is not online. ninjoe2012
Joined: 11 Mar 2012
Total Posts: 2143
17 Mar 2013 11:33 AM
Thanks. I'll try it out.
Report Abuse
UnAdmin is not online. 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
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
17 Mar 2013 11:57 AM
Reported for spam who?
Report Abuse
UnAdmin is not online. 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
ninjoe2012 is not online. ninjoe2012
Joined: 11 Mar 2012
Total Posts: 2143
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image