Im using this script
wait(1.5)
local sp = script.Parent
local Humanoid = sp:WaitForChild("Humanoid")
local Head = sp:WaitForChild("Head")
local Torso = sp:WaitForChild("Torso")
local Animation = script:WaitForChild("AttackAnim")
local Zombie = Instance.new("Sound",Torso)
Zombie.Volume = 1.5
Zombie.SoundId = "http://www.roblox.com/asset/?id=266272124"
spawn(function() Zombie:Play() end)
local Hit1 = Instance.new("Sound",Torso)
Hit1.Volume = 2
Hit1.SoundId = "http://www.roblox.com/asset/?id=4059009185"
local Hit2 = Instance.new("Sound",Torso)
Hit2.Volume = 2
Hit2.SoundId = "http://www.roblox.com/asset/?id=5775721420"
local AttackEnabled = true
function waiting(TimeToWait)
if TimeToWait ~= nil then
local TotalTime = 0
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:waiting()
while TotalTime < TimeToWait do
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:waiting()
end
else
game:GetService("RunService").Heartbeat:waiting()
end
end
function DamageTag(parent,damage)
local DmgTag = script.DamageTag:clone()
DmgTag.Damage.Value = damage
DmgTag.creator.Value = game.Players.LocalPlayer
DmgTag.Disabled = false
DmgTag.Parent = parent
end
local Anim = Humanoid:LoadAnimation(Animation)
function Hit(hit)
wait(0.5) local TargetHum = hit.Parent:FindFirstChild("Humanoid")
if TargetHum ~= nil and TargetHum:IsA("Humanoid") and AttackEnabled == true and TargetHum ~= Humanoid then
AttackEnabled = false
delay(0.5,function() AttackEnabled = true end)
if Anim then Anim:Play(nil,nil,2) end
DamageTag(TargetHum.Parent,30)
wait(0.1)
Hit1:Play()
wait(0.1)
Hit2:Play()
end
end
for _, Child in pairs(script.Parent:GetChildren()) do
if Child:IsA("Part") or Child:IsA("WedgePart") or Child:IsA("CornerWedgePart") then
Child.Touched:connect(Hit)
end
end
This is a script to make the zombies attack any humanoid they come in contact with. The script i'm looking for is one to attack only players without having to change the name of the humanoid

2 comments
PLEASE but please put a code block
Sorry, this is my first time asking a question