|
Well, I'm trying to make a dash animation and a crouch animation, and they work fine but after you get out of that appearance, you lose the limbs that have just been adjusted .3.
function Sprint()
local LArm = c:FindFirstChild("Left Arm")
local LArmWeld
local OriginalSpeed = c.Humanoid.WalkSpeed
c.Humanoid.WalkSpeed = c.Humanoid.WalkSpeed +c.Humanoid.WalkSpeed*SprintSpeed
if LArm then
LArmWeld = Instance.new("Weld", c)
LArmWeld.Part0 = LArm
LArmWeld.Part1 = c.Torso
LArmWeld.C0 = CFrame.new(0,0,0)*CFrame.new(1.5,0.2,-0.5)
LArmWeld.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) *CFrame.Angles(5, 0, 0)
end
local RArm = c:FindFirstChild("Right Arm")
local RArmWeld
if RArm then
RArmWeld = Instance.new("Weld", c)
RArmWeld.Part0 = RArm
RArmWeld.Part1 = c.Torso
RArmWeld.C0 = CFrame.new(0,0,0)*CFrame.new(-1.5,0.2,-0.5)
RArmWeld.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) *CFrame.Angles(5, 0, 0)
end
Sprinting = true
repeat
Stamina = Stamina -0.005
rs.Stepped:wait()
until not Sprinting or Stamina < 0.01
Sprinting = false
if LArmWeld then
LArmWeld.Parent = nil
end
if RArmWeld then
RArmWeld.Parent = nil
end
c:makeJoints()
c.Humanoid.WalkSpeed = OriginalSpeed
end
See what's really happening here.
http://www.roblox.com/pls-weld-place?id=54446137 |
|
|
I've posted more than 5 questions in a row and none of them were answered... I think I might get a spot in the Guinness Records book for 2015 soon! |
|
NyxisJoin Date: 2012-11-15 Post Count: 3374 |
are you reconnecting the limbs? |
|
|
How would I do that?
And yes, I've tried using :MakeJoints() if that's what you mean |
|
NyxisJoin Date: 2012-11-15 Post Count: 3374 |
no, I don't mean MakeJoints().
I mean connecting the motors in the torso again |
|
|
NyxisJoin Date: 2012-11-15 Post Count: 3374 |
TORSO["Left Hip"].Part1 = CHARACTER["Left Leg"]
this is assuming Left Hip exists, you'd do the same for each limb.
Left Shoulder > Left Arm
Right Shoulder > Right Arm
Left Hip > Left Leg
Right Hip > Right Leg |
|
|
Where would I put that in the script? |
|
|
It seems that as soon as I finish sprinting, the Motors are gone because the limbs have fallen off .-. |
|
NyxisJoin Date: 2012-11-15 Post Count: 3374 |
might be because when you weld your limbs it removes the motors.
this script I made sets the Part1 of the Player's motors to nil, then sets it back a second later. it seems to fix my limbs.
example:
local Motors = {}
for _,v in pairs(workspace.Player.Torso:GetChildren()) do
if v:IsA("Motor6D") and v.Name ~= "Neck" then
table.insert(Motors, v)
v.Parent = nil
delay(1, function()
for i = 1, #Motors do
Motors[i].Parent = workspace.Player.Torso
end
end)
end
end |
|
|