How to add spread

Im trying to make a shotgun in roblox studio right now, but I dont know how to make the spread. I want it to just be in one direction, since i want it to be a top- down shooter, but i dont know how to make it.


game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr)
	local humRP = plr.Character:FindFirstChild("HumanoidRootPart")
	for i = -3,3 do
		local part = Instance.new("Part")
		part.Shape = Enum.PartType.Ball
		part.CanCollide = false
		part.Parent = workspace
		part.Position = humRP.Position
		part:ApplyImpulse((humRP.CFrame.LookVector + i*5) * 50 + Vector3.new(0,10,0))
		wait(0.1)
	end
end)

i tried multiplying i to get the angle, but i dont think roblox studio angles work like that. Any help would be greatly appreciated!

You can multiply the humRP.CFrame with CFrame.Angles (with randomized angles in radians) and then use the resulting CFrame’s lookVector. As an example:

part:ApplyImpulse((humRP.CFrame * CFrame.Angles((math.random() - 0.5) * math.PI / 3, (math.random() - 0.5) * math.PI / 3, 0)).lookVector * FORCE)

Hopefully this gets you started :smiley:. I apologize if there are typos, I’m writing this on my phone.