Create one tick of damage (like an explosion)

How would I create a single tick of damage at a certain time? For example, if I wanted to make an explosion, how would I make sure that there is only one amount of damage (-2 instead of -1 and -1) being applied and only at a certain time? I only need a theory explanation, no specific code needed.

You can use debounce.
I’m assuming you mean to make a bomb that has a time and then explodes. Using the wait() you can set how long you want to wait and then connect that to a function that uses :TakeDamage() function in humanoid to take damage. When starting the function and the humanoid is found make it so it fires only when debounce is true. (Make debounce a variable). In that if statement immediately set debounce to false so it doesn’t damage the player more times than it should. I don’t have access to my computer currently so I can show you the code, but I hope you get what I mean.

1 Like

Would I use the Part.Touching event to check if a humanoid is touching it or would there be an easier way?

Personally, I would use part.Touched:Connect(function()

You can still use part.Touching, but I use part.Touched.

You can type:

``

Part.Touched: Connect(function(hit)
local humanoid = hit.Parent:WaitForChild(“Humanoid”)

``

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.