Grab attack killing both players when victim dies?

Hey all,
I’m currently making a small little vampire-styled FFA game, and I just got to scripting the grab move for the vampires. It’s not done, obviously, as the victim needs a way to escape, and it doesn’t deal damage (Except for when it connects). However, I’ve came across an issue: whenever the victim dies while grabbed, for some reason, the captor instantly dies as well.

I’ve tried disabling the BreakJointsOnDeath for when a player spawns, but that didn’t work. I’ve attached a video below so you can clearly see how it’s supposed to go (i scripted it so it just automatically makes the victim escape after 3 seconds), and when the bug occurs. I think it might be an issue with the weld? Not sure. (Video might be a little loud, and sorry about the horrible quality)

(The welds are connected to each players torso)

3 Likes

Have you tried welding it to each players’ HRP instead? I’m guessing that when the victim dies, its torso pulls the player’s torso as well and breaks the joints, which then kills the player assuming that the RequiresNeck property of the player’s Humanoid is turned on.

1 Like

They were originally that, but I’ll try it again. One second
Edit: Nope, still doesn’t work

2 Likes

You could possibly try breaking the weld right before you kill them?

If not you could create an invisible part to weld the grabbed person to and using alignposition or a script to set its position to the same as the person grabbing’s torso position.

2 Likes

Can you try disabling the RequiresNeck property of the player’s Humanoid?

Alright, let me trythat real fast

2 Likes

Still killed the player. Let me try another solution I just came up with

1 Like

Nope, changing it to a WeldConstraint didn’t seem to work

Could i possibly see a snippet of the code?

Sorry if it’s messy or bad. I’m pretty tired.

local role = model:GetAttribute("Role")
						if model.Name == player.Name then print("Plr Hit") return end
						canHit = false
						hitbox.Color = Color3.fromRGB(0,255,0)
						model:SetAttribute("Killer", player.Name)
						model:SetAttribute("WeaponUsed", "Claws")
						local hitSfx = Instance.new("Sound")
						hitSfx.Parent = model
						hitSfx.SoundId = "rbxassetid://150185025"
						hitSfx.Volume = 2
						hitSfx.RollOffMaxDistance = 25
						hitSfx:Play()
						grabAnim:Destroy()
						track:Destroy()
						
						local grabbedAnim = Instance.new("Animation", targetHumanoid)
						grabbedAnim.Name = "GrabbedAnimation"
						grabbedAnim.AnimationId = "rbxassetid://17808249636"
						local grabbedTrack = targetHumanoid:LoadAnimation(grabbedAnim)
						grabbedTrack:Play()
						
						
						local grabAnim = Instance.new("Animation", humanoid)
						grabAnim.Name = "GrabbingAnimation"
						grabAnim.AnimationId = "rbxassetid://17808251446"
						local grabTrack = humanoid:LoadAnimation(grabAnim)
						grabTrack:Play()
						
						local grabWeld = Instance.new("WeldConstraint")
						grabWeld.Name = "GrabWeld"
						grabWeld.Parent = target
						grabWeld.Part0 = target
						grabWeld.Part1 = model:FindFirstChildWhichIsA("Humanoid").RootPart
						--model:FindFirstChildWhichIsA("Humanoid").RootPart.CFrame  = CFrame.new(0,0,-1.5)
						model:FindFirstChildWhichIsA("Humanoid").RootPart.Orientation = player.Character:FindFirstChildWhichIsA("Humanoid").RootPart.Orientation
						targetHumanoid:TakeDamage(10)
						targetHumanoid.PlatformStand = true
						targetHumanoid.AutoRotate = false
						targetHumanoid.WalkSpeed = 0
						targetHumanoid.JumpPower = 0
						
						targetHumanoid.Died:Connect(function()
							if grabWeld then
								grabWeld:Destroy()
							end
						end)
						
						task.wait(2)
						escapeEvent:Invoke(model, player.Character)
					end

Try testing it without destroying the grabweld. It might be a flaw in your kill code.

1 Like

Still killed the player … It’s likely related to the welds.

It killed the player when the weld wasnt destroyed?

Can I see the kill code or is it already in the block provided?

There’s no script that kills the player, the only thing that damages the player as of now is the targetHumanoid:TakeDamage(10) line

Attach them with an alignorientation and an alignposition, as they are not welds, they are not broken upon death.

1 Like

You shouldn’t use welds when attaching a character to another character, I recommend using either physics constraints, or a well positioned animation with each other. I heard about using Motor6D’s as an option but I haven’t tested that out.

1 Like

You can blame roblox’s worldclass character system, humanoid. No fix for this.

1 Like

Hey all, sorry for the late response: but it has been fixed (by a now good friend of mine). ObbyCreator reached out to help me fix it, and I’d never forgive myself if I never provided a solution, so:
To anyone that may have this issue in the future… use alignposition and alignorientation, not welds. It works wonders (it may not be as good as welds, but you won’t have the issue anymore lol).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.