|
| 15 Oct 2011 04:06 PM |
function onKeyDown(key) local key = key:lower() if key == "r" then local arms = nil local torso = nil local legs = nil local head = nil local welds = {} local char = script.Parent.Parent.Parent.Character
arms = {char:findFirstChild("Right Arm"), char:findFirstChild("Left Arm")} torso = char.Torso legs = {char:findFirstChild("Right Leg"), char:findFirstChild("Left Leg")} head = char.Head if arms ~= nil and torso ~= nil and legs ~= nil and head ~= nil then shoulders = {char.Torso:findFirstChild("Left Shoulder"), char.Torso:findFirstChild("Right Shoulder")} hips = {char.Torso:findFirstChild("Right Hip"), char.Torso:findFirstChild("Left Hip")} neck = char.Torso:findFirstChild("neck") if shoulders ~= nil and hips ~= nil and neck ~= nil then local yes = true if yes then yes = false shoulders[1].Part1 = nil shoulders[2].Part1 = nil hips[1].Part1 = nil hips[2].Part1 = nil neck = nil local weld1 = Instance.new("Weld") weld1.Part0 = torso weld1.Parent = torso weld1.Part1 = arms[1] weld1.C1 = CFrame.new(-0.5,1, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0, math.rad(-90)) weld[1] = weld1 local weld2 = Instance.new("Weld") weld2.Part0 = torso weld2.Parent = torso weld2.Part1 = arms[2] weld2.C1 = CFrame.new(-1, 0, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 50, 0) welds[2] = weld2 end else print("shoulders") end else print("arms") end else print("legs") end end
function onSelected(mouse) mouse.KeyDown:connect(onKeyDown) end
script.Parent.Selected:connect(onSelected)
it says it's running fine but if i move it justy prints legs,and if i click r it just prints shoulders,It's supposed t weld when i click r D: |
|
|
| Report Abuse |
|
nexus4345
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 398 |
|
|
| 15 Oct 2011 04:18 PM |
| This doesn't weld if there isn't already a weld |
|
|
| Report Abuse |
|
|
| 15 Oct 2011 04:29 PM |
| It should weld i said Instance.new("Weld") |
|
|
| Report Abuse |
|
|
| 15 Oct 2011 04:39 PM |
| There are already welds in a player's Character. It won't reweld. |
|
|
| Report Abuse |
|
|
| 15 Oct 2011 04:41 PM |
| Err this gives me a hedache frome anger. so exactly how manny parts of this script would i have to delete and redo? |
|
|
| Report Abuse |
|