Hello I have this script that I made in my submarine game.
function onTouched(hit)
if hit.Name == "rocket" then
local tere=script.parent.pohi.customPhysicalProperties
script.Parent.pohi.CustomPhysicalProperties = PhysicalProperties.new(tere.Density + 0.1, 0, 0)
end
end
script.Parent.Touched:connect(onTouched)
I have 2 problems with it. First right now it works if a rocket touches it but I also need it to work if a torpedo touches it like this: if hit.Name == "rocket" and "torpedo" then. The problem is that when I insert the or torpedo text then it will react to everything for example terrain water which is bad for me.
THe second problem is that I want this script to apply to every part in a model and I tried to make it so but I failed. So if anyone could help me with this I would be grateful. Thanks for your time!
