Yes, I know what you're thinking; "This is so easy, health is not a valid member of a model!".
But, I used the FindFirstChild() function, but still, it doesn't work.
Client script: (Local script, inside tool)
tool = script.Parent
player = game.Players.LocalPlayer
tool.Equipped:Connect(function(mouse)
mouse.Icon = "http://www.roblox.com/asset/?id=2312592107"
mouse.Button1Down:Connect(function()
game.Workspace.KillExplosion.KillExplosionCreate:FireServer(mouse.Target, tool.Handle)
end)
end)
Server script: (Normal script, inside workspace)
debounce = false
script.KillExplosionCreate.OnServerEvent:Connect(function(player, target, tool)
if debounce == false and target.Parent:FindFirstChild("Humanoid") then
debounce = true
tool.BrickColor = BrickColor.new("Really red")
player = target.Parent.Humanoid
player.Health = player.Health - 18
wait(1)
debounce = false
tool.BrickColor = BrickColor.new("Sea green")
end
end)
I have no idea why this doesn't work. So, when I click on something that doesn't have a Humanoid I get the error:
Health is not valid member of Model
BUT I USED THE FIND FIRST CHILD FUNCTION! WHY??!!
ERROR AT LINE 8, SERVER SCRIPT

5 comments
I tested your script,it works fine, when you click on a model with a humanoid did its health decrease?
you might want to try changing line 07 to local player instead, as there is already another player argument defined at the start of the funcction
Humanoid.Health = Humanoid.Health - 19 ( or use the :TakeDamage() method which is easier, Humanoid:TakeDamage(19) )
The problem is, if I don't click on anything with a Humanoid, I get an error.
But FindFirstChild is supposed to remove that error, and ONLY run if the thing that is clicked is a Humanoid.