Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a touched event that does an Area Of Effect of damage?

Basically, I want multiple entities touched the same object and being affected by it at the same time. So something like group damage.

I've tried making a table of things that touched it and making the effect of all the objects on the table, but I realize I haven't done that right.

1 answer

✓ Accepted answer

You have the right idea

-- Get things that touched it

local list = {}

part.Touched:connect(function(h)
	if h.Parent:FindFirstChild("Humanoid") then
		list[#list+1] = h.Parent.Humanoid
	end
end)

-- Dish out damage
for i = 1,#list do
	list[i]:TakeDamage(50)
end

1 comment

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.