Hello! My attacks are continuously instakilling the opponent when they are ragdolled and about to get up. I suspect it either has something to do with the knockback module or the ragdoll module. Here are both:
-- RAGDOLL SCRIPT
local ragdoll = {}
function ragdoll.Start(character)
if character.Rag.Value == true then return end
character.Rag.Value = true
for i, joint in pairs(character:GetDescendants()) do
if joint:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a0 = Instance.new("Attachment")
local a1 = Instance.new("Attachment")
a0.Parent = joint.Part0
a1.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a0
socket.Attachment1 = a1
a0.CFrame = joint.C0
a1.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joint.Enabled = false
end
end
character.Humanoid.WalkSpeed = 0
character.Humanoid.JumpPower = 0
character.Humanoid.PlatformStand = true
character.Humanoid.AutoRotate = false
end
function ragdoll.Stop(character)
local hrp = character:FindFirstChild("HumanoidRootPart")
local hum = character:FindFirstChild("Humanoid")
hum.PlatformStand = false
for i, joint in pairs(character:GetDescendants()) do
if joint:IsA("BallSocketConstraint") then
joint:Destroy()
end
if joint:IsA("Motor6D") then
joint.Enabled = true
end
end
character.Rag.Value = false
hum:ChangeState(Enum.HumanoidStateType.GettingUp)
hum.WalkSpeed = 16
hum.JumpPower = 50
hum.AutoRotate = true
end
return ragdoll
knockback:
local kb = {}
function kb.Start(character, direction)
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp == nil then return end
local att = Instance.new("Attachment", hrp)
local lv = Instance.new("LinearVelocity", att)
lv.MaxForce = 9999999
lv.VectorVelocity = direction
lv.Attachment0 = att
game.Debris:AddItem(att, 0.1)
end
return kb
I forgot to mention this because it only happens with special moves. I think it might be because of the code of those scripts, too so here’s one of them:
local event = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("VenomPunch")
local SS = game:GetService("SoundService")
local v = game:GetService("ServerStorage").VFX.Glow
local vv = game:GetService("ServerStorage").VFX.Glow2
local vvv = game:GetService("ServerStorage").VFX.Lighting1
local vvvv = game:GetService("ServerStorage").VFX.Lighting2
local vvvvv = game:GetService("ServerStorage").VFX.Lighting3
local vvvvvv = game:GetService("ServerStorage").VFX.Spec
local vvvvvvv = game:GetService("ServerStorage").VFX.Spec2
local ah = game:GetService("ServerStorage").Models.VPhitbox
local kb = require(game.ServerScriptService.ModuleScripts.MainScript.Knockback)
local ragdoll = require(game.ServerScriptService.ModuleScripts.MainScript.Ragdoll)
local StunModule = require(game.ReplicatedStorage.ModuleScripts.StunHandle)
local UltModule = require(game.ReplicatedStorage.ModuleScripts.UltHandle)
local db = {}
event.OnServerEvent:Connect(function(plr)
local char = plr.Character
local AT = char.Humanoid:LoadAnimation(script.Animation)
AT:Play()
char.CanAttack.Value = false
char.Humanoid.WalkSpeed = 0
char.Humanoid.JumpPower = 0
local VFX1 = v:Clone()
local VFX2 = vv:Clone()
local VFX3 = vvv:Clone()
local VFX4 = vvv:Clone()
local VFX5 = vvvv:Clone()
local VFX6 = vvvvv:Clone()
local VFX7 = vvvvvv:Clone()
local VFX8 = vvvvvvv:Clone()
local hitbox = ah:Clone()
VFX1.Parent = char["Right Arm"]
VFX2.Parent = char["Right Arm"]
VFX3.Parent = char["Right Arm"]
VFX4.Parent = char["Right Arm"]
VFX5.Parent = char["Right Arm"]
VFX6.Parent = char["Right Arm"]
VFX7.Parent = char["Right Arm"]
VFX8.Parent = char["Right Arm"]
wait(0.6)
hitbox.Parent = workspace
hitbox.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2)
hitbox.Massless = true
hitbox.Anchored = false
local weld = Instance.new("WeldConstraint")
weld.Part0 = hitbox
weld.Part1 = char.HumanoidRootPart
weld.Parent = workspace
SS.hit_punch_m:Play()
char.CanAttack.Value = true
local cantdam = {}
hitbox.Touched:Connect(function(hit)
if table.find(db, hit.Parent) then return end
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= plr.Name then
if table.find(cantdam, hit.Parent.Name) then return end
table.insert(cantdam, hit.Parent.Name)
hitbox:Destroy()
if hit.Parent:GetAttribute("Blocking") == true then
hit.Parent:SetAttribute("Stunned", true)
hit.Parent:SetAttribute("Blocking", false)
hit.Parent.Humanoid.WalkSpeed = 0
hit.Parent.Humanoid.JumpPower = 0
wait(3)
hit.Parent:SetAttribute("Stunned", false)
hit.Parent.Humanoid.WalkSpeed = 16
hit.Parent.Humanoid.JumpPower = 50
end
SS["Electric Explosion"]:Play()
hit.Parent.Humanoid:TakeDamage(10)
print("damaged")
if char.Ultbar.Value <= char.MaxUlt.Value then
char.Ultbar.Value += 3
end
table.insert(db, hit.Parent)
kb.Start(hit.Parent, (hit.Parent.HumanoidRootPart.Position - hitbox.Position).Unit * Vector3.new(50, 0, 50) + Vector3.new(0, 10))
ragdoll.Start(hit.Parent)
StunModule.StunTimed(char,2)
UltModule.UltAdd(char,5)
task.wait(2)
table.remove(db, table.find(db, hit.Parent))
table.remove(cantdam, table.find(cantdam, hit.Parent))
ragdoll.Stop(hit.Parent)
end
end)
wait(0.5)
VFX1:Destroy()
VFX2:Destroy()
VFX3:Destroy()
VFX4:Destroy()
VFX5:Destroy()
VFX5:Destroy()
VFX6:Destroy()
VFX7:Destroy()
VFX8:Destroy()
weld:Destroy()
wait(0.2)
char.Humanoid.WalkSpeed = 16
char.Humanoid.JumpPower = 50
end)
Sorry for not updating in so long, I completely forgot. I don’t actually own the game, so the owner actually made 2 ragdoll modules, which was causing the problem. Thank you for helping, and I will give you the solution.