I have a occurring problem with the characters humanoid not dying, anyone know a fix?
robloxapp-20250115-2205461.wmv (2.2 MB)
What’s the code you are using?
local function HitHandler(part, knockback, ragdollTime, damage)
if part:GetAttribute("Hit") then
return
end
if part.Parent:GetAttribute("Hit") then
return
end
if not part.Parent:IsA("Accessory") then
if part.Parent == game.Workspace then
if not part.Anchored then
part:SetAttribute("Hit", true)
print(part.Name)
local bv = Instance.new("BodyVelocity")
bv.Parent = part
bv.MaxForce = Vector3.new(1, 1, 1) * math.huge
bv.Velocity = Vector3.new(0, knockback * 5, 0)
game.Debris:AddItem(bv, 0.1)
task.wait(0.1)
part:SetAttribute("Hit", nil)
end
end
if part.Parent:FindFirstChild("Humanoid") then
local character = part.Parent
local hrp = character.HumanoidRootPart
local ragdollFolder = character:FindFirstChild("Ragdoll_Folder")
local ragdollEvent = ragdollFolder.Ragdoll
character:SetAttribute("Hit", true)
if ragdollTime ~= 0 then
ragdollEvent.Time.Value = ragdollTime
ragdollEvent:Fire()
end
local bv = Instance.new("BodyVelocity")
bv.Parent = hrp
bv.MaxForce = Vector3.new(1, 1, 1) * math.huge
bv.Velocity = Vector3.new(0, knockback * 5, 0)
game.Debris:AddItem(bv, 0.1)
if damage then
character.Humanoid:TakeDamage(damage)
end
task.wait(0.1)
character:SetAttribute("Hit", nil)
end
end
end
I solved the problem, when the player dies platform stand has to be set to false, or the player wont die