halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:23 PM |
If i had a brick named a and wanted to move it's y axis up 1 (It is at 2 now so i want to move it to 3),would i type this?
a.Position = Vector0.new
I think that is wrong though. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:24 PM |
If you want to move it one up no matter what X is a.Position = a.Position + Vector3.new(0, 1, 0)
If you want to move it's X to a specific location a.Position = Vector3.new(a.Position.X, 3, a.Position.Z)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
| |
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:27 PM |
| Could i also use -1 to make it move down? |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:28 PM |
Yup
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:29 PM |
| So would this work to make a platform o go up and down on the click of a button. |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:30 PM |
Sorry forgot to post the script
a = script.Parent.Parent.a function onClicked() a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(1) a.Position = a.Position + Vector3.new(0, 1, 0) wait(5) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) a.Position = a.Position + Vector3.new(0, -1, 0) wait(1) end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:30 PM |
Yes, using this method would work for that.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:31 PM |
| I meant the script above,i just posted it would that work? |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:32 PM |
| Yay i made it work,i'm getting a little better every day :) |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:33 PM |
| How would you make it move up smoother? |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:34 PM |
Oops, I replied before I saw the script... anyways, yes, that should work. However, using CFrame would work a lot better, along with loops and some stuff to prevent players from clicking it a lot. Here's a nicer version:
local a = script.Parent.Parent.a local enabled = true script.Parent.ClickDetector.MouseClick:connect(function() if (not enabled) then return end enabled = false for i = 1, 8 do a.CFrame = a.CFrame + Vector3.new(0, 1, 0) wait(1) end for i = 1, 8 do a.CFrame = a.CFrame - Vector3.new(0, 1, 0) wait(1) end enabled = true end)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:35 PM |
Again, I posted before I saw your replies ._. here's it smoother:
local a = script.Parent.Parent.a local enabled = true script.Parent.ClickDetector.MouseClick:connect(function() if (not enabled) then return end enabled = false for i = 1, 160 do a.CFrame = a.CFrame + Vector3.new(0, .05, 0) wait(.05) end for i = 1, 160 do a.CFrame = a.CFrame - Vector3.new(0, .05, 0) wait(.05) end enabled = true end)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:38 PM |
Yay thx,how would you change the color of a brick?
|
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 11:39 PM |
a.BrickColor = BrickColor.new("Really red") Here's a list: http://wiki.roblox.com/index.php/BrickColor_Codes
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
halo9789
|
  |
| Joined: 17 Nov 2010 |
| Total Posts: 86 |
|
|
| 17 Aug 2013 11:42 PM |
| Yay thx again,sorry for so many q's its just i cant really find what i wanna know on wiki.roblox.com |
|
|
| Report Abuse |
|
|