Sound spamming and too much force

i have this script which flings the player when touching it and a sound plays but the sound spams when you touch it and also it needs to fling the player less because now it glitches

-- Adds a repulsive force to anything this object touches
local Part = script.Parent

local Debris = game:GetService('Debris')

local CharacterToIgnore = script:WaitForChild('CharacterToIgnore').Value

local MAGNITUDE = 3E4
local TIME_OF_FORCE = 0.5

Part.Touched:connect(function(other)
	if other.Parent == CharacterToIgnore or (other.Parent and other.Parent.Parent == CharacterToIgnore) then return end
	if not other.Anchored then
		local punchSound = script:FindFirstChild('PunchSound')
		if punchSound then punchSound:Play() end
		local direction = (other.Position - Part.Position).unit
		local bodyForce = Instance.new('BodyForce')
		bodyForce.force = MAGNITUDE * direction
		bodyForce.Parent = other
		Debris:AddItem(bodyForce, TIME_OF_FORCE)
	end
end)
	
1 Like

it doesnt play the sound anymore and doesnt fling me anymore too

do you mind helping me on my second most recent topic? ive had it up for days and no one is helping…

hey, my game uses size changing mechanics and ive noticed that after changing size the flinging doesnt work anymore.