Hi, i don't understand why i keep getting this error. I'm trying to make a script where you deal 10 damage when touching a part.
local Main = script.Parent Main.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit:TakeDamage(10) end end)
Also the script is inside a model as you can see here: (http://i.imgur.com/Hq4jPvJ.png)
The model contains a humanoid because i want it to display a name above it.
Take Damage only works with a humanoid. You've done it with a part so it won't work. So you'll have to change hit:TakeDamage to hit.Parent:FindFirstChild("Humanoid"):TakeDamage 10, also I recommend maybe using a debounce system, as the touched event fires multiple times.