#i am able to air jump while ragdolled and in air

1 messages · Page 1 of 1 (latest)

onyx spoke
#

i tried to make a collision group but it didnt work even though it printed false for collisions

#
function module.Main(stick: Tool, char: Model, victim: Model)
    local victimHum = victim:FindFirstChild("Humanoid")
    local victimHrp = victim:FindFirstChild("HumanoidRootPart")
    
    if not victimHrp then return end
    if not char then return end
    if not victim then return end
    if not victimHum then return end
    
    setUpHumanoid(victimHum)
    createCollisionParts(victim)
    buildJoints(victim)
    Knockback(stick:GetAttribute("knockback"), stick:GetAttribute("upKb"), stick:GetAttribute("knockbackTime"), victim, char)
    
    task.delay(stick:GetAttribute("ragdollTime"), function()
        unRagdoll(victim)
        revertHumanoid(victimHum)
    end)
end

return module
#
function unRagdoll(victim: Model)
    for _, v in victim:GetDescendants() do
        if v:IsA("BallSocketConstraint") and v.Parent.Name ~= "CollisionPart" then
            v:Destroy()
        elseif v:IsA("Motor6D") then
            v.Enabled = true
        elseif v:IsA("BasePart") and v.Name == "CollisionPart" then
            v:Destroy()
        end
    end
end
#
function revertHumanoid(hum: Humanoid)
    hum.PlatformStand = false
    hum.AutoRotate = true
    
    hum:ChangeState(Enum.HumanoidStateType.GettingUp)
end
#
function setUpHumanoid(hum: Humanoid)
    hum.BreakJointsOnDeath = false
    hum.RequiresNeck = false
    hum.PlatformStand = true
    hum.AutoRotate = false
end
#
function makeCollisionGroups(collisionPart: BasePart, limb: BasePart)
    local group1 = "CollisionGroupCollisionPart"
    local group2 = "CollisionGroupLimb"
    
    PhysicsService:RegisterCollisionGroup(group1)
    PhysicsService:RegisterCollisionGroup(group2)
    
    collisionPart.CollisionGroup = group1
    limb.CollisionGroup = group2
    
    PhysicsService:CollisionGroupSetCollidable(group1, group2, false)
    
    print(PhysicsService:CollisionGroupsAreCollidable(group1, group2))
end
#
function buildJoints(victim: Model)
    for _, v in victim:GetDescendants() do
        if v:IsA("Motor6D") and v.Parent.Name ~= "CollisionPart" then
            local att0, att1 = Instance.new("Attachment"), Instance.new("Attachment")
            att0.CFrame = v.C0
            att1.CFrame = v.C1
            att0.Parent = v.Part0
            att1.Parent = v.Part1
            
            local ballSocket = Instance.new("BallSocketConstraint")
            ballSocket.Attachment0 = att0
            ballSocket.Attachment1 = att1
            ballSocket.Parent = v.Part0
            ballSocket.TwistLimitsEnabled = true
            ballSocket.LimitsEnabled = true
            
            v.Enabled = false
        end
    end
end
acoustic salmon
#

-# @onyx spoke, you weren't able to send one of the codes because it contained an abbreviation for something inappropriate.

onyx spoke
#

huh?

#

@acoustic salmon , what abbreviation was it?

#

the collision part variable?

acoustic salmon
onyx spoke
#

ah, ill be more careful