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)
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.