I have this Hl2 game I'm trying to make and I made morphs, although adding this part it is constantly breaking the script.

for i,v in pairs(game.Players:GetChildren() do
characters = v.Character
end

-- Later in the shoot function

	elseif part.Parent.Parent.Parent:IsDescendantOf(characters) then
		part.Parent.Parent.Parent:FindFirstChild("Humanoid"):TakeDamage(script.Parent.EDIT.Damage.Value)
		hit = true
		local blood = script.Parent.EDIT.Blood:Clone()
		blood.Parent = part
		blood.Enabled = true
		game.Debris:AddItem(blood,.2)
	end

But when you shoot parts of the character without the morph it injures them

3 comments

0

first, check if that elsif statement is even being run by putting something like print("elseif is being run") in the first line there.

0

if it is in fact being run, check that you have the correct object because that part.Parent.Parent.Parent seems like you might just being looking at the wrong object (I'd recomment turning that into a variable to make it easier to read and edit in the future).

0

Also, without the full script, if the problem is not in the things I listed, we can't actually help you with anything because we also don't know what the values or cloned objects are and if problems are occuring inside of them.