magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 04:30 PM |
whats wrong?
function onTouch(hit) e = hit.Parent:GetMass() x = e * 200 m = instance.new("BodyForce") m.name = "hmm" m.force = 0, x, 0 m.Parent = e end
script.Parent.Touched:connect(OnTouch) |
|
|
| Report Abuse |
|
|
Zarcius
|
  |
| Joined: 08 Dec 2007 |
| Total Posts: 3024 |
|
|
| 24 Oct 2010 04:31 PM |
| You can't GetMass of a model? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 04:32 PM |
| not a model it's just a part |
|
|
| Report Abuse |
|
|
Zarcius
|
  |
| Joined: 08 Dec 2007 |
| Total Posts: 3024 |
|
|
| 24 Oct 2010 04:32 PM |
| That, there's a lowercase "i" in Instance.new and your connection line (OnTouch) should be (onTouch). |
|
|
| Report Abuse |
|
|
Zarcius
|
  |
| Joined: 08 Dec 2007 |
| Total Posts: 3024 |
|
|
| 24 Oct 2010 04:32 PM |
| That, there's a lowercase "i" in Instance.new and your connection line (OnTouch) should be (onTouch). |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 24 Oct 2010 04:36 PM |
function onTouch(hit) e = hit:GetMass() x = e * 196.22 m = Instance.new("BodyForce") m.Name = "hmm" m.force = Vector3.new(0, x, 0) m.Parent = hit end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 04:37 PM |
now this is what i have got
function onTouch(hit) e = hit:GetMass() x = e * 200 m = Instance.new("BodyForce") m.Name = "hmm" m.force = 0, x, 0 <--- problem line m.Parent = e end
script.Parent.Touched:connect(onTouch)
the output is saying this :
Workspace.Part.Script:6: bad argument #3 to '?' (Vector3 expected, got number) Workspace.Part.Script, line 6 stack end Disconnected event because of exception
|
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 04:47 PM |
now what is wrong with this?
function onTouch(hit) if script.Parent.Value.Value == true then hit.Ancored = true wait() hit.Ancored = false else end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 24 Oct 2010 04:48 PM |
You spelled "Anchored" wrong.
function onTouch(hit) if script.Parent.Value.Value == true then hit.Anchored = true wait() hit.Anchored = false else end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 04:51 PM |
| thanks and another question, if you anchor something does it's velocity cancel out like if there is a weightless block thats moving then you anchor it work like a split second then unanchor it would it stop or keep going? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2010 04:57 PM |
| Think of a ship. When it lets an anchor go, does it stop, or keep going? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 05:00 PM |
if there is a current it will start going or if it starts it's engines it will start going but if there is no current or it doesn't start it's engines it doesn't go.
whats this got to do with anything? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 24 Oct 2010 05:12 PM |
| When you anchor a brick, it's velocity stays but is "disabled". When you unanchor it the velocity is at the velocity it was before and is now "enabled" again. |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 05:14 PM |
| so how would you turn the velocity to 0, 0, 0? |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 24 Oct 2010 05:15 PM |
BRICK.Velocity = Vector3.new(0,0,0)
Fun Fact! To get the "speed" of a brick: speed = BRICK.Velocity.magnitude print(speed) |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 05:20 PM |
| thanks, and 1 last thing, if there a way to round numbers from like 10703.4809384 to 10703? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2010 05:21 PM |
function round(num) return math.floor(num + 0.5) end
round(1.0545327) >1
round(2.6883) >3 |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 05:23 PM |
| umm sorry i don't really understand that :( |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Oct 2010 06:05 PM |
| *insert humming of still alive from portal* |
|
|
| Report Abuse |
|
|