Cloning and playing sounds causing so much lag

Ok so I have this script that basically makes it so you can make the same sound play multiple times at once:


	local Sound = script.Sounds:FindFirstChild(WeaponSounds[Gun]):Clone()

	Sound.Parent = Player.Character:FindFirstChildWhichIsA("Tool").Handle

	Sound.PlaybackSpeed = math.random(100,120)/100

	Sound:Play()

I can’t just play it normally because it cut’s itself off, but this code causes a ton of lag when someone with a fast firing weapon shoots. Does anyone know any alternative way to fix this?

Maybe because the sound doesn’t delete and stay cloned inside the gun’s handle, which is prolly the cause of lags.

I use this for my Framework, which works perfectly and sound doesn’t stop playing when unequipping.
This should work fine.

local Sound = script.Sounds:FindFirstChild(WeaponSounds[Gun]):Clone()
Sound.PlayOnRemove = true
Sound.PlaybackSpeed = math.random(100, 120) / 100
Sound.Parent = Player.Character:FindFirstChildWhichIsA("Tool").Handle
Sound:Destroy()
2 Likes