doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 28 Dec 2012 01:36 PM |
Mine keeps teleporting me to position 0,0,0. What can I do to stop this? (I know this isn't scripting helpers, but they have no clue what to do.)
mesh = "http://www.roblox.com/asset/?id=13640868" texture = "http://www.roblox.com/asset/?id=18987684"
function onClicked(player)
h = player.Character.Head p = Instance.new("Part") b = Instance.new("Hat") m = Instance.new("SpecialMesh") w1 = Instance.new("Weld")
b.Parent = player.Character
p.Parent = b p.Name = "Handle" p.FormFactor = "Plate" p.Size = Vector3.new(2,.8,2) p.CanCollide = false
m.Parent = p m.MeshType = "FileMesh" m.MeshId = mesh m.TextureId = texture
w1.Parent = p w1.Part0 = player.Character.Head w1.Part1 = p w1.C1 = CFrame.new(0,-.785,0)
end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2012 01:39 PM |
Abit more context, please?
|
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 28 Dec 2012 01:42 PM |
this part is teleporting my character to point 0,0,0 on the map. It shouldn't be.
w1.Parent = p w1.Part0 = player.Character.Head w1.Part1 = p w1.C1 = CFrame.new(0,-.785,0) |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 28 Dec 2012 01:45 PM |
Welds hate me, but you can always try this:
w1.Part0 = player.Character.Head w1.Part1 = p w1.C0 = player.Character.Head.CFrame:inverse() w1.C1 = CFrame.new(0,-.785,0):inverse() w1.Parent = p |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 28 Dec 2012 01:55 PM |
| now the hat is teleporting to 0,0,0 but my character is not. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2012 02:06 PM |
| You need to move the part before welding it to the character. |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
| |
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 28 Dec 2012 02:29 PM |
| If you are using a hat, why don't you just use the hat object? |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 28 Dec 2012 03:08 PM |
| How can I spawn one on someones head and it stay? |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 28 Dec 2012 03:09 PM |
| Also, I want to put multiple hats on people. |
|
|
| Report Abuse |
|
|
HotThoth
|
  |
 |
| Joined: 24 Aug 2010 |
| Total Posts: 1176 |
|
|
| 28 Dec 2012 03:43 PM |
That script would error out because you are not passing a Vector3 to CFrame.new(). Also, this post should be in Scripting Helpers.
- HotThoth |
|
|
| Report Abuse |
|
|
TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 28 Dec 2012 04:37 PM |
Before welding a newly created part call its BreakJoints method.
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|