Troble with using Region3 to deal damage and Tweening at the same time

I made a skill, and I’m trying to add damage to it, I’m using a module script to deal the dmg, but when I call the module script function, it doesn’t deal dmg and the skill doesn’t tween, even if I use spawn()

Here’s the module script:

local skillsModule = {}

skillsModule.damagePlr = function(position, size, dmg, skillType, duration, x) 
	
	local pos1 = position - (size / 2)
	local pos2 = position + (size / 2)
	
	local region = Region3.new(pos1, pos2)
	
	local partsInRegion = game.Workspace:FindPartsInRegion3(region)
	
	if skillType == "Single" then
	
		for i, v in pairs(partsInRegion) do
			
			if v.Parent:FindFirstChild("Humanoid") then
				
				v.Parent:FindFirstChild("Humanoid"):TakeDamage(dmg)
				
			end
		
		end
		
	elseif skillType == "Multiple" then
		
		while wait(duration) do
			
			wait(x)
			
			for i, v in pairs(partsInRegion) do
			
				if v.Parent:FindFirstChild("Humanoid") then
					
					print("Plr is in hitbox!")
					
					v.Parent:FindFirstChild("Humanoid"):TakeDamage(dmg)
					
				end
		
			end
			
		end
		
	end
	
end

return skillsModule

Here’s the skill script (the part where I call the function):

spawn(skillsModule.damagePlr(hitbox.Position, hitbox.Size, 5, "Multiple", 5, 1))

Under the function call, it’s the tweening stuff, which doesn’t happen

should I use coroutines instead?

local damageCrtn = coroutine.wrap(skillsModule.damagePlr(hitbox.Position, hitbox.Size, 5, "Multiple", 5, 1))
damageCrtn()

Would this work? (I’m new to coroutines)

You pass the arguments into the coroutine call

okay let me do that (30 chars)

local damageCrtn = coroutine.wrap(skillsModule.damagePlr())
damageCrtn(hitbox.Position, hitbox.Size, 5, "Multiple", 5, 1)

like this? it doesn’t work

can anybody help? I need to run the module function and the tweens at the same time