Strange error while trying to kill a player

Hi, I’ve made this script placed inside every character.

Screenshot 2023-12-29 alle 18.37.25

local part = script.Parent:WaitForChild("HumanoidRootPart")
local players = game:GetService("Players")
local playerEatenEvent = game:GetService("ReplicatedStorage").PlayerKilled

part.Touched:Connect(function(hit)
	if hit.Name == "HumanoidRootPart" then
		local characterTouched = hit.Parent
		local otherPlayer = players:GetPlayerFromCharacter(characterTouched)
		local touchedCharacterSize = characterTouched.CharacterSize
		
		local myCharacter = script.Parent
		local myPlayer = players:GetPlayerFromCharacter(myCharacter)
		local myCharacterSize = myCharacter.CharacterSize
		
		if myCharacterSize.Value > touchedCharacterSize.Value then
			print(myPlayer.Name .. " is bigger than " .. otherPlayer.Name)
			print(myCharacterSize.Value, touchedCharacterSize.Value)
			
			characterTouched.Humanoid.Healt = 0
			playerEatenEvent:FireClient(myPlayer, touchedCharacterSize.Value)
		else
			print(otherPlayer.Name .. " is bigger than " .. myPlayer.Name)
			print(touchedCharacterSize.Value, myCharacterSize.Value)
			
			myCharacter.Humanoid.Healt = 0
			playerEatenEvent:FireClient(otherPlayer, touchedCharacterSize.Value)
		end
	end
end)

However it returns Healt is not a valid member of Humanoid any ideas? ty :heart:

1 Like

Health -----------------------------

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.