I am trying to make a button that is connected to the zombie's chest or something that kills the zombie. The zombie doesn't have a name to prevent the name from showing, but there is a humanoid part called "Zombie" if that could be used. Here is the script:
function OnClick() script.Parent.Parent.health = 0 end
I am still new at scripting, so please go easy on me. :)
Like hiimgoodpack said, you need to connect it to and event.
All the events for click detectors are here: http://wiki.roblox.com/index.php?title=API:Class/ClickDetector
If this is a SurfaceGui, then all events for text buttons are here: http://wiki.roblox.com/index.php?title=API:Class/TextButton
Here is a script for if you are using a text button.
function onClicked() script.Parent.Parent:FindFirstChild("Humanoid").Health = 0 --this is considering that the parent you are addressing is the model. end script.Parent.MouseButton1Click:connect(onClicked) --this is untested
Accept the answer if it helped