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.

3 comments
Sorry im on mobile so it may not look right idrk
It worked! I appreciate your help.
np glad i could help