#Knockback and ragdoll

1 messages · Page 1 of 1 (latest)

keen prism
#

bet

blazing thunder
keen prism
blazing thunder
#

I mean to discuss this script..

rich parrotBOT
#

studio** You are now Level 1! **studio

keen prism
#

discutting

#

nah men it’s chill it’s basic script idc

tropic wedge
#

Should be pretty easy to make

#

Just identify all ur weapons in the module and use them in ur main script

#

And don't forget to require the module script

jagged niche
#

This is lowkey hilarious

haughty talon
keen prism
#

so 4 the weapon module i created all ur weapon stats go here - dmg, cd, kb force, ragdoll duration n hitbox size. both client n server can access it. wanna new weapon? copy paste n change values ez

rich parrotBOT
#

studio** You are now Level 3! **studio

keen prism
#

-- In ReplicatedStoragethen ModulesthenWeaponStats
-- Config for all weapons - edit values here

local Module = {
["Basic"] = {
Damage = 10,
Cooldown = 0.8,
Knockback = 50, -- Force multiplier
RagdollTime = 1.5, -- Secs before standup
HitboxSize = Vector3.new(4, 4, 4)
},

["Heavy"] = {
    Damage = 25,
    Cooldown = 1.4,
    Knockback = 120,
    RagdollTime = 2.5,
    HitboxSize = Vector3.new(5, 5, 5)
},

["Slap"] = {
    Damage = 5,
    Cooldown = 0.5,
    Knockback = 80,
    RagdollTime = 2,
    HitboxSize = Vector3.new(3, 3, 3)
}

}

return Module

#

@blazing thunder

#

@tropic wedge what did you think for the moment ?

tropic wedge
#

?

blazing thunder
#

I mean the other thing

#

I think I've explained it wrong

blazing thunder
#

Yeah, I did

keen prism
#

wait it’s not finisht

#

i made the tagoll

#

ragdoll

blazing thunder
#

I meant that I need the knockback system, but its power can be adjusted in module (ik how to make module)

keen prism
#

wait

#

i made a ragdollmodile

tropic wedge
#

based on the table

keen prism
# blazing thunder I meant that I need the knockback system, but its power can be adjusted in modul...

-- ReplicatedStorage then Modules then RagdollModule
-- Handles ragdoll on and off and the knokbak force

local RagdollModule = {}

-- Enable ragdoll on with the char flnxtion RagdollModule.Enable(character)
local hum = character:FindFirstChild("Humanoid")
if not hum then return end

--  here you can set the ragdol state
hum:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
hum:ChangeState(Enum.HumanoidStateType.Physics)
hum.PlatformStand = true
#

-- Convert Motor6D to sockets for physic
for _, motor in pairs(character:GetDescendants()) do
if motor:IsA("Motor6D") and motor.Name ~= "RootJoint" then
-- Create constraint
local socket = Instance.new("BallSocketConstraint")
socket.Name = "RagdollSocket"

        local att0 = Instance.new("Attachment")
        att0.Name = "RagAtt0"
        att0.CFrame = motor.C0
        att0.Parent = motor.Part0
        
        local att1 = Instance.new("Attachment")
        att1.Name = "RagAtt1"
        att1.CFrame = motor.C1
        att1.Parent = motor.Part1
        
        socket.Attachment0 = att0
        socket.Attachment1 = att1
        socket.LimitsEnabled = true
        socket.TwistLimitsEnabled = true
        socket.Parent = motor.Part0
        
        -- Disable motor
        motor.Enabled = false
    end
end

end

-- Disable ragdoll on char
function RagdollModule.Disable(character)
local hum = character:FindFirstChild("Humanoid")
if not hum then return end

#

-- Remove sockets + atts pairs(character:GetDescendants()) do
if obj.Name == "RagdollSocket" or obj.Name == "RagAtt0" or obj.Name == "RagAtt1" then
obj:Destroy()
end
end

-- Re-enable motors
for _, motor in pairs(character:GetDescendants()) do
    if motor:IsA("Motor6D") then
        motor.Enabled = true
    end
end

-- Reset thestate
hum.PlatformStand = false
hum:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
hum:ChangeState(Enum.HumanoidStateType.GettingUp)

end

-- Apply knockback force to HRP
function RagdollModule.ApplyKnockback(character, direction, force)
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then return end

-- Use LinearVelocity for smooth kb
local att = Instance.new("Attachment")
att.Name = "KBAttachment"
att.Parent = hrp

local lv = Instance.new("LinearVelocity")
lv.Name = "KnockbackForce"
lv.Attachment0 = att
lv.MaxForce = math.huge
lv.VectorVelocity = direction * force
lv.Parent = hrp

-- Remove force after short delay
task.delay(0.15, function()
    if lv then lv:Destroy() end
    if att then att:Destroy() end
end)

end

return RagdollModule

keen prism
blazing thunder
#

Yeah

#

That's pretty much it

keen prism
#

or you want the

#

hithandler

#

and weapon client ?

#

???

blazing thunder
#

I will do it

keen prism
#

u sure ?

blazing thunder
#

I mostly needed the ragdoll system

blazing thunder
keen prism
#

I know you saw that message dude

blazing thunder
#

I saw

#

My friend just online i don't want him to see me

keen prism
#

yeah yeah..