im creating boulders that kill you.
i made the script tell the part to change the players health to 0 when its touched. when i playtest my game the boulder killed me even though i had a forcefield. is there a way to fix this?
current script:
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild(“Humanoid”) then
hit.Parent.Humanoid.Health = 0
end
end)
i also tried doing this:
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild(“Humanoid”) and not hit.Parent:FindFirstChild(“ForceField”) then
hit.Parent.Humanoid.Health = 0
end
end)