Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Touched is not a valid member of script will someone help?

Asked by 3 years ago
Edited 3 years ago

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

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

Answer this question