How i can do the function at all part in the same time

for _, I in ipairs(game.Workspace.FanhsPoint:GetChildren())do
	if I:IsA("Part") then
		I.Touched:Connect(function(plr)
			local player = game.Players:GetPlayerFromCharacter(plr.Parent)
			
		end)
		while wait(0.1) do
			I.Orientation = I.Orientation + Vector3.new(0,1,0)
		end
	end
end

You can put the code in the for loop inside a task.spawn(), or a coroutine.

for _, child in workspace.FanhsPoints:GetChildren() do
    task.spawn(function()
        -- Add your code in here.
    end)
end
1 Like

ty bro

for _, I in ipairs(game.Workspace.FanhsPoint:GetChildren())do
	
	task.spawn(function(plr)
		while wait(0.1) do
			I.Orientation = I.Orientation + Vector3.new(0,1,0)
		end
	end)
end