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 » Scripting Helpers
Home Search
 

Re: Can someone help meh.

Previous Thread :: Next Thread 
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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 is not online. 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
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
15 Oct 2011 04:29 PM
It should weld i said Instance.new("Weld")
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
15 Oct 2011 04:39 PM
There are already welds in a player's Character. It won't reweld.
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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