Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 24 Mar 2014 06:47 PM |
local Plr = script.Parent.Parent.Parent.Parent.Parent local Tank = game.Lighting.Tank1 function Clone() C1 = Tank:Clone() C2 = C1:Clone() C2.Parent = game.Workspace C2:CreateJoints() C2.CFrame = CFrame.new(Plr.Character.Head.CFrame + CFrame.new(0, 0, 10)) end
function onClickClone() Clone() end
script.Parent.MouseButton1Down:connect(onClickClone)
-Stravus Police Department- (C) Commissioner :: Join today! |
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 24 Mar 2014 06:56 PM |
Anyone?
-Stravus Police Department- (C) Commissioner :: Join today! |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 24 Mar 2014 06:57 PM |
I think this is what you're looking for.
C2.CFrame = Plr.Character.Head.CFrame + Plr.Character.Head.CFrame.lookVector*10
Also, unless Tank1 is one part, this still won't work because you can't set the model's CFrame like that. You'd want to use TranslateBy, which works a little differently. |
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 24 Mar 2014 07:05 PM |
How would I do that?
-Stravus Police Department- (C) Commissioner :: Join today! |
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 24 Mar 2014 07:06 PM |
And I was trying to get it to spawn infront of you.
-Stravus Police Department- (C) Commissioner :: Join today! |
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 24 Mar 2014 07:22 PM |
Well???
-Stravus Police Department- (C) Commissioner :: Join today! |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 25 Mar 2014 03:41 PM |
It's pretty straightforward if you read the wiki. TranslateBy will use the supplied vector3 as kind of a displacement. In other words, it won't go to the position you supply as you'd expect, but if you treat the model as the origin rather than the point (0,0,0), then you can pretend that translateby is moving the model to the point you supply. However, if you use that example then it's worth noting that the model's rotation is not taken into account (I believe) so say I supply the vector3 (1,0,0), it will move the object on the global x-axis as opposed to the model's x-axis (since it might be rotated). Hopefully this made sense. In the end you'll want something like C2.CFrame = Plr.Character.Head C2:TranslateBy(Plr.Character.Head.CFrame.lookVector*10) |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 25 Mar 2014 03:44 PM |
| Dont use lighting, use serverstorage. |
|
|
| Report Abuse |
|
|