cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 20 Apr 2014 11:10 AM |
So I'm new to Lua and I'm trying to make a script which makes a block slowly move up the Y-cordinate.
part = script.Parent while 0 < 1 do part.Position[1] = part.Position[1] + 1 --Since Position is in a Tuple --I'm trying to get [0,1,2] or [x,y,z] out of the tuple. --After that I'm trying to modify it. What am I doing wrong. end
|
|
|
| Report Abuse |
|
|
|
| 20 Apr 2014 11:12 AM |
You need to use a wait in that loop or else your game would just crash since 1 is always more than 0. Also, use CFrame: http://wiki.roblox.com/index.php?title=CFrame
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
subenari
|
  |
| Joined: 23 Mar 2011 |
| Total Posts: 116 |
|
|
| 20 Apr 2014 11:12 AM |
part = script.Parent y = script.Parent.Position.Y while wait() do y = y+1 part.CFrame = CFrame.new(Vector3.new(part.Position.X, y, part.Position.Z) end
i'm' sure there are other ways to do it that are better than this but this was all I could think of |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2014 11:14 AM |
Not sure what a Tuple is, but if you want to move it up only the Y-Axis you can do something with this:
p = part.Position while wait(.1) do p = p + Vector3.new(p.x, p.y + 1, p.z) end |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 20 Apr 2014 11:20 AM |
A tuple is like a list but organized differently.
thx guys. |
|
|
| Report Abuse |
|
|