So I have a murder game and i'm trying to make a kill script, that if I click someone's root part or Torso, they die. But it's just erroring and ugh... I just need help. This script is a server script inside of serverscriptservice.
Script:
game.Players.PlayerAdded:Connect(function(player)
local Mouse = player:GetMouse()
if player.Backpack.EquippedTool == "DefKnife" then
if Mouse.Target.Parent.Name == "HumanoidRootPart" or "Torso" then
Mouse.Target.Parent.Parent.Humanoid.MaxHealth = 0
end
end
end)

3 comments
Is your output enabled? What is the error you're getting?
By "erroring" I mean not working. It won't kill /:
Try changing the Health instead of Max Health. Also, just make a script inside of the tool itself that is activated upon Activation or Equipping or whatever you want it to be.