Weird particle bug causing lag

when you input particles jet out, and freeze the game. there is an attachment with the particles in the players torso if that helps

while the player is in the game longer, the lag per input increases, and the particles jet out more.

ive tried searching for similiar issues and found nothing, and ive also tried to optimise my script a little more, but the issue persists. here is my script if it helps:

local char = script.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
local visual = game.Lighting.RaceVisuals
change = true
while wait() do
	if plr.statFolder.Race.Value == "Stardre" then
		if char:FindFirstChild("Stardre") == nil and change == true then
			change = false
			local MC = visual.Stardre:Clone()
			MC.Parent = char
			local cn = visual.stardy.Attachment:Clone()
			cn.Parent = char.Torso
		end
		end
	end
2 Likes

Have you checked your torso for the amount of particles you have? Iā€™m not seeing an optimized code in here, nor do I really understand what it does.

i have checked multiple times, even renaming it to see if it keeps just removing then duplicating, im really stuck on what to do as ive been trying to fix this for 2 hours by now