I'm trying to make a gomba but I got an error. It says "Touched is not a valid member of script." Heres the script:
for key, object in pairs(script.Parent:GetChildren()) do
if object:IsA("Part") or object:IsA("MeshPart") then
end
object.Touched:Connect(damage) --Where I recieved the error.
end

3 comments
you forgot to add function after connect it should be: object.Touched:Connect(function(damage)
Ohh, I didn't realize that! I'll try that and see if it works. Thanks!
It worked! Thank you!