Im trying to make a script so when a character gets touched by a laser it will die. Im able to make so when the laser touches some parts in the character but i need the whole character cuz otherwise they wont die when the laser touches those parts. Heres the script: (I dont get any errors cuz this script works fine but not as i want it to)
laser = script.Parent
laser.Touched:Connect(function(part)
for i,v in pairs(game.Players:GetPlayers()) do
if part.Parent.Name == "Humanoid" then
part.Parent.Health = 0
elseif part.Name == "Head" then
part.Parent.Humanoid.Health = 0
elseif part.Parent == v.Name then
part.Parent.Humanoid.Health = 0
end
end
end)
