Also, one more thing to point out. .Touched only returns part instances not things to do with the terrain. If you want to detect the grass, I suggest you could add a invisible part above the grass and just name it the grass detector.
local GrassDetector = game.Workspace.GrassDetector
local Hit = game.Workspace.Hit
Hit.Shape = "Ball" -- Make sure it is a ball
Hit.Touched:Connect(touched)
if touched.Name == "GrassDetector" then
--- do whatever you want
end
end)
Oh if the grass is a part then make sure there is only one part that is named “Grass” but the main problem here is that the touched is nil which also tells us that the ball cannot be touched, maybe the ball is not a basepart?
The ball has to be a basepart in order for you to connect it with the touched event.
Just make an invisible box around the ball and weld it to the ball so that when the ball moves it won’t disconnect and add the touched event to that invisible box because that invisible box is a basepart which means it can use the touched event.