How do i get rid of this error? Touched is not a valid member of workspace.WoodCrate

I was working on a script that would allow a model to give health points to players whenever they’re low on health points but i got this error that i find confusing to understand since im new to roblox scripting and never had that error before. The video below will get you to know what im talking about… (sorry for the lag you’re about to experience).

Here’s the script as well

script.Parent.Touched:Connect(function(hit)
	local newHealth = 30
	local player = hit.Parent.Name
	if player then
		player.Health = player.Health + newHealth
	end
	
	script.Parent:Destroy()
end)

Touched is only an event for parts, not the model containing the parts. Try something like this:

script.Parent.PartName.Touched

Also fyi you can just press F9 to get to the console!

If you want to make the crate touchable first union all of the crates parts together then ungroup the union from the model and then implement your script. If the crate is made of meshes an etc then make your own crate then union it then try your script.

Touched Doesn’t work for models. Try setting the touched to a child part of the model.
Also use F9 To open the console, much easier.