I didn't post the whole script, only the part im having trouble with.
Character is me (the player that is punching, passing with remote event, local -> server)
m is the other player.
I tried doing if Character is looking at the m they take damage, but now the enemy won't even take damage, even if i am facing or not, what am i Doing wrong?
for i,m in pairs(game.Workspace:GetChildren()) do
if m and m:FindFirstChild("Humanoid") and m ~= Character then
if (Character.HumanoidRootPart.CFrame.LookVector - m.HumanoidRootPart.Position).Magnitude <= 8 then
print("humanoid nearby")
m.Humanoid.Health -= 10

1 comment
looking at m would require you to be directly looking at m. You might want to make the look at a little more broad for it to work.