how can I make balls that dmg other ppl when u shoot it ?
COMMUNITY QUESTION
how can I make balls that dmg other ppl ?
1 answer
Hello so to make the ball hurt someone when shot put this script inside of the ball that shoots out.
local debounce = false --able to deal damage
local HealthLoss = 5--this is the damage dealt to the player
function OnTouched(Part) --when player touches ball which means when the ball touches player
if Part.Parent ~= nil then
if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
debounce = true --not able to deal damage
Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss) --player looses health
wait(2) --how long till player can take damage again delete if you don't need
debounce = false --able to deal damage
end
end
end
script.Parent.Touched:connect(OnTouched)
hope this helps you out I explained enough of what does what.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
scriptinghelpers is not a request site.
Learn about body velocity, .touched event, and particle emmiters (for design).