Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to create and manipulate lineforces via code?

Asked by 2 years ago
Edited 2 years ago

I'm trying to make an active ragdoll, and im using lineforces and attatchments to make him ball up, but the lineforces wont respond to my code, even when i had them physically placed into the ragdoll dummy's limbs. Heres my code:

lf1 = Instance.new("LineForce",bodyparts.LeftArm)
lf1.ReactionForceEnabled = true
lf1.InverseSquareLaw = true
lf1.Magnitude = 1250
lf1.MaxForce = 1000

lf2 = Instance.new("LineForce",bodyparts.RightArm)
lf2.ReactionForceEnabled = true
lf2.InverseSquareLaw = true
lf2.Magnitude = 1250
lf2.MaxForce = 1000

lf3 = Instance.new("LineForce",bodyparts.LeftLeg)
lf3.ReactionForceEnabled = false
lf3.InverseSquareLaw = false
lf3.Magnitude = 1250

lf4 = Instance.new("Lineforce",bodyparts.RightLeg)
lf4.ReactionForceEnabled = false
lf4.ReactionForceEnabled = false
lf4.Magnitude = 1250

function ballup()
    lf1.Attatchment0 = attatchments.LeftGrip
    lf1.Attatchment1 = attatchments.LeftFaceGrip

    lf2.Attatchment0 = attatchments.RightGrip
    lf2.Attatchment1 = attatchments.RightFaceGrip

    lf3.Attatchment0 = attatchments.LeftFoot
    lf3.Attatchment1 = attatchments.LeftAss

    lf4.Attatchment0 = attatchments.RightFoot
    lf4.Attatchment1 = attatchments.RightAss

wait(MaxHealth - Health)

    lf1.Attatchment0 = attatchments.LeftGrip
    lf1.Attatchment1 = nil

    lf2.Attatchment0 = attatchments.RightGrip
    lf2.Attatchment1 = nil

    lf3.Attatchment0 = attatchments.LeftFoot
    lf3.Attatchment1 = nil

    lf4.Attatchment0 = attatchments.RightFoot
    lf4.Attatchment1 = nil
end

1 answer

Log in to vote
0
Answered by 2 years ago

nimblz luke deez nutz

Ad

Answer this question