I don't get any errors, I've tested it with multiple players, and it simply doesn't do damage.

Fix?

My attempted fix is at line 7 - 9

local bullet = script.Parent

local function playerCheck(otherPart)	
	local humanoid = otherPart.Parent:FindFirstChild("Humanoid")	
	if humanoid and humanoid.Parent.Name ~= bullet.Attacker.Value then
		local enemyplayer = humanoid.Parent:GetPlayerFromCharacter(humanoid.Parent)
		local player = game.Players:FindFirstChild(bullet.Attacker.Value)
		if player.Team ~= enemyplayer.Team then
		humanoid:TakeDamage(100)
		otherPart:Destroy()
		local player = game.Players:FindFirstChild(humanoid.Parent.Name)
		if player then
			local tag = player:FindFirstChild("Killer")
			if tag then
				tag.Value = bullet.Attacker.Value
				end
			end
		end
	end
end

2 comments

0

Maybe you can try replacing player.Team ~= enemyPlayer.Team with player.TeamColor ~= enemyPlayer.TeamColor

0

just enable team kill