I've been trying to figure out how to damage every player, I searched for solutions on google and none of them worked, Here is what I got so far.
game.Workspace.i.Touched:Connect(function(hit)
print("Touched")
if hit.Parent:FindFirstChild("Humanoid") then
print("Found a Character!")
if hit.Parent:FindFirstChild("pathfinding") then
print("Its an enemy!")
hit.Parent:Destroy()
print("they died now")
--here is the part where it damages every player
print("damaged player")
end
end
end)
What happens In this script is when an enemy touches a part that its walking to using a script and then uses the same script to detect if its an NPC since the player does not have that script inside them it then deletes the NPC after it touches it and damages every player at the server
You can tell its a defense game.
