Hi, I’ve made this script placed inside every character.
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