function touched(body)
body.HumanoidRootPart.Touched:Connect(function(hit)
local otherPlayer = game.Players[hit.Parent.Name]
print(otherPlayer)
if otherPlayer == game.ServerScriptService.RoundHandler.EnemyPlayerName.Value then
script.Parent.Humanoid.Health = 0
end
end)
end
game.Players.PlayerAdded:Connect(function(newPlayer)
newPlayer.CharacterAdded:Connect(touched)
end)
the player is supposed to be killed when the player with enemyplayername name touches the person. the script doesn't work.

4 comments
I'm also kind of confused as to what your script is actually doing. It looks like it's inside of your character, and whenever someone else touches the enemy player, you die? Wouldn't you tailor it to kill you when you touch the enemy player and not when someone else touches the enemy player? Just a little confused is all.
Sorry, When i touch the enemy player I'm supposed to die.
and also game.Players[hit.Parent.Name] <-- the string is right there, it's getting the name
No. It's not getting the name. It's getting the instance of the player that has the name you provided.