generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do you guys do welds?

Previous Thread :: Next Thread 
doneyes is not online. 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
Abasiophilia is not online. Abasiophilia
Joined: 09 Sep 2012
Total Posts: 99
28 Dec 2012 01:39 PM
Abit more context, please?

Report Abuse
doneyes is not online. 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 is not online. 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 is not online. 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
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
28 Dec 2012 02:06 PM
You need to move the part before welding it to the character.
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
28 Dec 2012 02:21 PM
I don't understand how.
Report Abuse
eJorge is not online. 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 is not online. 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 is not online. 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 is not online. HotThoth
Forum Moderator
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image