What I mean, is how would I make this do 150 damage when it hits a player or a NPC? Also how to make it have a 2/4 chance of breaking that enemies joints if their MaxHealth is less than 1000?
pellet = script.Parent
function onTouched(hit)
humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
g = Instance.new("Explosion")
g.ExplosionType = Enum.ExplosionType.NoCraters
g.Parent = game.Workspace
g.Position = script.Parent.Position
g.BlastRadius = 5
g.BlastPressure = 1000
pellet:remove()
else
script.Parent.PelletScript2.Disabled = false
script.Parent.PelletScript:remove()
end
end
connection = pellet.Touched:connect(onTouched)

1 comment
If you want it to kill anything, no matter how much health it has, set the damage to
inf.