I made a script that kills someone if their name is not the same as a model's name (after 2 letters,) however, the script continues to kill everyone, regardless of their name. There are no errors. Here is the script:
script.Parent.Touched:connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") then
script.Parent.hit:Play()
hit:Destroy()
else
local nm = hit.Parent.Parent.Name
local tb = script.Parent.Parent.Name
if nm ~= string.sub(tb,3) then
hit.Parent.Humanoid:TakeDamage(100)
script.Parent.hit:Play()
wait(1)
end
end
end)
