drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 03:45 PM |
| You know how in the position if you click the plus next to it in properties? How would I use that in a script, I've tried Position.Y and Y.Position and they havn't worked. |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 13 Oct 2011 03:46 PM |
| Position.Y should work, but you can't directly assign to it, you can only get the value. |
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 03:47 PM |
I've tried this but it doesn't work:
repeat O.CFrame = O.CFrame + Vector3.new(0,0.1,0) H.CFrame = H.CFrame + Vector3.new(0,0.1,0) V.CFrame = V.CFrame + Vector3.new(0,0.1,0) wait(.005) until O.Position.Y > 12 |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 03:51 PM |
problem is with line 2: you can't use CFrame + Vector3.new(), here's it fix: repeat O.CFrame = O.CFrame * CFrame.new(0,0.1,0) H.CFrame = H.CFrame * CFrame.new(0,0.1,0) V.CFrame = V.CFrame * CFrame.new(0,0.1,0) wait(.005) until O.Position.Y > 12 |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 13 Oct 2011 03:51 PM |
"wait(.005)"
If I remember right that is lower than what is possible. Just use "wait()" when in doubt.
As for the rest of the Script I see no problem with it.
|
|
|
| Report Abuse |
|
|
|
| 13 Oct 2011 03:52 PM |
| Like Ben said, you cant "change" the value directly... |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 03:52 PM |
| it's not the "wait" that's breaking it, I fixed it. |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 13 Oct 2011 03:52 PM |
@Wil2
Actually he can. A Part has a CFrame and a Position property. CFrame consists of the Position and the Orientation/Rotation so you can always add to the Position. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
| |
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 03:54 PM |
| ya but, if your changing the position using CFrame, you can't do + Vector3.new() it only works if your changing pos with the position prop, for cframe, to add cframe to an existing cframe, you use * CFrame.new() |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 13 Oct 2011 03:55 PM |
@Wil2
He already had it working perfectly so forget about your idea of it not working. The problem is the call of the Position.Y. |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 03:57 PM |
actually this works: repeat O.CFrame = O.CFrame + Vector3.new(0,0.1,0) H.CFrame = H.CFrame + Vector3.new(0,0.1,0) V.CFrame = V.CFrame + Vector3.new(0,0.1,0) wait(.005) until O.Position.Y > 12 |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 13 Oct 2011 03:58 PM |
@Wil
You can add a Vector3 to a CFrame to increase a CFrame. Just as CFrame moves a brick into another brick, adding a Vector3 to a CFrame does the same thing. |
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 04:04 PM |
| @Wil changing the '+' and '-' to '*' didn't work. It says got playerstat but expected something else. |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 04:09 PM |
| are you sure your trying to move a brick and not a gui? |
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 04:14 PM |
| Its a brick, S'posed to go up until it hits the max. |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
| |
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Oct 2011 04:15 PM |
like: O,H,V = workspace.P1,workspace.P2,workspace.P3 |
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 04:21 PM |
Yah, they are, here's the full script:
script.Parent.Touched:connect(function(hit) if script.Parent.Active.Value == false then humanoid = hit.Parent:FindFirstChild("Humanoid") torso = hit.Parent:FindFirstChild("Torso") if humanoid then H = script.Parent V = script.Parent.Parent.Vert O = script.Parent.Parent.Orb if torso then script.Parent.Active.Value = true H.Spin.Disabled = false V.Spin.Disabled = false torso.Anchored = true scrpt = script.Parent.Pos:Clone() scrpt.Parent = torso scrpt.Disabled = false repeat O.CFrame = O.CFrame * Vector3.new(0,0.1,0) H.CFrame = H.CFrame * Vector3.new(0,0.1,0) V.CFrame = V.CFrame * Vector3.new(0,0.1,0) wait(.005) until O.Position.Y > 13 repeat O.CFrame = O.CFrame * Vector3.new(0,-0.1,0) H.CFrame = H.CFrame * Vector3.new(0,-0.1,0) V.CFrame = V.CFrame * Vector3.new(0,-0.1,0) wait(.005) until O.Position.Y < 7 torso.Pos:Remove() torso.Anchored = false H.Spin.Disabled = true V.Spin.Disabled = true end wait(10) script.Parent.Active.Value = false end end end)
pos is a script that makes sure the player's torso is in the same position of the sphere, there's nothing wrong with it though, I'm positive.
|
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
|
| 13 Oct 2011 04:23 PM |
script.Parent.Touched:connect(function(hit) if script.Parent.Active.Value == false then humanoid = hit.Parent:FindFirstChild("Humanoid") torso = hit.Parent:FindFirstChild("Torso") if humanoid then H = script.Parent V = script.Parent.Parent.Vert O = script.Parent.Parent.Orb if torso then script.Parent.Active.Value = true H.Spin.Disabled = false V.Spin.Disabled = false torso.Anchored = true scrpt = script.Parent.Pos:Clone() scrpt.Parent = torso scrpt.Disabled = false ---------------------------------------------------------Wrong part below! repeat O.CFrame = O.CFrame * Vector3.new(0,0.1,0) H.CFrame = H.CFrame * Vector3.new(0,0.1,0) V.CFrame = V.CFrame * Vector3.new(0,0.1,0) wait(.005) until O.Position.Y > 13 repeat O.CFrame = O.CFrame * Vector3.new(0,-0.1,0) H.CFrame = H.CFrame * Vector3.new(0,-0.1,0) V.CFrame = V.CFrame * Vector3.new(0,-0.1,0) wait(.005) until O.Position.Y < 7 ---------------------------------------------------- torso.Pos:Remove() torso.Anchored = false H.Spin.Disabled = true V.Spin.Disabled = true end wait(10) script.Parent.Active.Value = false end end end)
|
|
|
| Report Abuse |
|
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
| |
|
drmiewlo
|
  |
| Joined: 14 Mar 2012 |
| Total Posts: 1782 |
|
| |
|