So I made a health pack, and I used a simple function:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent.Humanoid
if hum.Health < hum.MaxHealth and hum.Health > 0 then
hum.Health = hum.Health + 30
end
end
end)
But when I play the game it says, touched is not a valid of Model, and I mean obviously!
Any idea what I did wrong, cause I'm obviously not trying to reference a part inside the pack.
Hope you can help, and thank you for your time.

1 comment
Touched is nil in a model. This means that it doesn't even exist in models. Well, the event 'touched' or 'clicked' can only be used in parts. Try using the Base parts, so if you are using a model instead of a part, that won't work. Other than that, it might be a weird Studio glitch as it thinks that Touched is an object, not an event, and it sees that there are no objects called "Touched."