Projectile improvements?

I’ve recently started working on an old project that includes Projectiles - I’m currently attempting different ways in which I can improve the performance(s) of the ‘SpellParts’ used in-game. Granted, the one below works fine - However, I’ve come to understand performance issues, especially if theres a large amount of CFraming involved for each individual SpellPart // Player.

The code below works by the corresponding spell Requiring a ‘Create’ Module on the server and using the for i = 1,math.huge to loop the movements.

Help / Suggestions would be greatly appreciated.

local SpellSpeed = math.random(6, 10)
for Movement = 1, math.huge do 
	if not SpellPart then break end
	local SpellRay =, SpellPart.CFrame.LookVector * SpellSpeed)
	local Obj, Position = workspace:FindPartOnRay(SpellRay, IgnoreList) -- Is IgnoreList defined somewhere? It's not shown in your code block.
	if not Obj then
		SpellPart.CFrame = SpellPart.CFrame + SpellPart.CFrame.LookVector * SpellSpeed
		if Obj.Parent:FindFirstChild("Protection") == nil and Obj.Parent.Parent:FindFirstChild("Protection") == nil then
  			local HitObj ="Part")
			HitObj.Parent = Player.Character
			HitObj.Transparency = 1
			HitObj.Anchored, HitObj.CanCollide = true, false
			HitObj.Size, HitObj.CFrame =, 1, 1),
			local HitParticle = script["HitParticle"]:Clone()
			HitParticle.Parent = HitObj
			HitParticle.Enabled = true
			HitParticle.Color = SpellTrail.Color
			local HitParticle2 = script["HitParticle2"]:Clone()
			HitParticle2.Parent = HitObj
			HitParticle2.Enabled = true
			HitParticle2.Color = SpellTrail.Color
			require(Wand.Spells:FindFirstChild(SpellPart.Name)).Hit(Player, Obj)
			IgnoreList = nil
			SpellPart.CFrame =, Player.Character["HumanoidRootPart"].CFrame.p)

You can simply use while true do, not for loops.