Hello! i’m doing carrying knocked/downed players system for my combat game. But for some reason when tried to carry died player, other player dies too.
Note: Carry system uses WeldConstraint
Here’s a video about it:
How can i fix this?
Hello! i’m doing carrying knocked/downed players system for my combat game. But for some reason when tried to carry died player, other player dies too.
Note: Carry system uses WeldConstraint
Here’s a video about it:
How can i fix this?
Hi, in order for me or anyone else to help you we need to see your code. So could you post your code?
Carrying code for Server:
Events.GrabEvent.OnServerEvent:Connect(function(Player, TargetCharacter, Value)
if Value == "GrabPlayer" then
local GrabWeldConstraint = Instance.new("WeldConstraint")
GrabWeldConstraint.Part0 = Character["Right Arm"]
GrabWeldConstraint.Part1 = TargetCharacter.Torso
GrabWeldConstraint.Parent = Character["Torso"]
GrabWeldConstraint.Name = "GrabWeldConstraint"
TargetPlayerCharacter = TargetCharacter
elseif Value == "ThrowPlayer" then
if TargetCharacter["Torso"]:FindFirstChild("GrabWeldConstraint") then
Character["Right Arm"].GrabWeldConstraint:Destroy()
end
elseif Value == "DropPlayer" then
if TargetCharacter["Torso"]:FindFirstChild("GrabWeldConstraint") then
Character["Right Arm"].GrabWeldConstraint:Destroy()
end
end
end)
Carrying code for client:
UserInputService.InputBegan:Connect(function(Key)
if Equipped == true and Key.KeyCode == Enum.KeyCode.G then
for _, character in pairs(workspace:GetChildren()) do
if character:IsA("Model") and character:FindFirstChild("Humanoid") and character:FindFirstChild("Torso") and character:FindFirstChild("Downed") then
if character.Humanoid.Health <= 15 and character.Downed.Value == true and (character.Torso.Position - Tool.Handle.Position).Magnitude <= 5 and GrabDB == false and IsGrab == false then
IdleAnimation:Stop()
GrabPlayerAnimation:Play()
GrabIdleAnimation:Play()
TargetCharacter = character
GrabDB = true
IsGrab = true
wait(0.5)
Events.GrabEvent:FireServer(character, "GrabPlayer")
TargetCharacter = character
wait(1)
GrabDB = false
end
end
end
end
I don’t see anything in your scripts above about Health
or anything that is deleting a critical Weld
.
Why do you feel like the scripts above are causing the problem?
This code in client fires “DropPlayer”
while true do
wait()
if TargetCharacter:FindFirstChild("Humanoid") and TargetCharacter.Humanoid.Health <= 0 then
Events.GrabEvent:FireServer(TargetCharacter, "DropPlayer")
GrabIdleAnimation:Stop()
if IdleAnimation.IsPlaying == false and Equipped == true then
IdleAnimation:Play()
end
GrabDB = true
IsGrab = false
wait(1)
GrabDB = false
end
end
end
I would scan your scripts for something that is setting YOUR characters health to 0
or something that is deleting a weld from YOUR character like a Neck
weld.
Those are 2 things that will kill a character.
Theres no writen code for destroying player’s neck weld
I haven’t seen anything in the scripts posted that looks like it would kill YOUR player.
So I was saying maybe it’s some other script. Maybe your assigning a health value of 0 or deleting a critical weld like a Neck weld.
If you can’t find anything related to the neck, look at everything you have about your character, the characters weld’s, and the humanoids.
Nevermind, I solved the problem with using AlignPosition and AlignOrientation. But thanks for trying help.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.